On linux arm64 scan golang go parser failure

version: 8.9 & 9.9LTS
os:linux arm64
Java version:java 11 & 17
version: community edition

When the execution machine of the arm64 architecture scans golang, EXECUTION SUCCESS, but all go files fail to be parsed, and on web all files show “Go parser failure".
But on linux x86 and windows, EXECUTION SUCCESS and everything is normal.
what is the problem.

Hey there.

Any warnings/errors in the scanner logs of the arm64 machine when analyzing Go?

ERROR: Unable to parse file: file:///code/go/test_go_debug/test1002.go. 
ERROR: Cannot parse 'test1002.go': Stream closed 
ERROR: Unable to parse file: file:///code/go/test_go_debug/testfuncdepth1.go. 
ERROR: Cannot parse 'testfuncdepth1.go': Go parser external process returned non-zero exit value: 126 
ERROR: Unable to parse file: file:///code/go/test_go_debug/test1006.go. 
ERROR: Cannot parse 'test1006.go': Broken pipe 
ERROR: Unable to parse file: file:///code/go/test_go_debug/englishcopyright.go. 
ERROR: Cannot parse 'englishcopyright.go': Go parser external process returned non-zero exit value: 126

all errors is all here

I have a feeling that since there’s an arm64 version of Go, and we directly use Go to parse the language… something hasn’t been adjusted. I’ll flag this for attention.

Is there any update on this, because we are using sonar community version of 9.9 and go version of 1.18 but getting the same error “go parse failure”. Its arm64 arch

Hey there @Gvsl_Keerthana

Can you give a try with SonarQube v10.2? I believe SONARSLANG-589 should have made its way into SonarQube 10.0.

Hello @Colin,
We have tried upgrading to the latest to LTS 10.2.1-community, but even after that we are getting the same ERROR messages s below.

ERROR: Unable to parse file: file:///src/app/config/config.go.
ERROR: Cannot parse 'app/config/config.go': Stream closed
ERROR: Unable to parse file: file:///src/app/client/goorange.go.
ERROR: Cannot parse 'app/client/goorange.go': Go parser external process returned non-zero exit value: 126
ERROR: Unable to parse file: file:///src/app/server/http_server_test.go.
ERROR: Cannot parse 'app/server/http_server_test.go': Go parser external process returned non-zero exit value: 126
ERROR: Unable to parse file: file:///src/app/server/sqs_listener.go.
ERROR: Cannot parse 'app/server/sqs_listener.go': Go parser external process returned non-zero exit value: 126
ERROR: Unable to parse file: file:///src/app/client/goorange_test.go.
ERROR: Cannot parse 'app/client/goorange_test.go': Go parser external process returned non-zero exit value: 126
ERROR: Unable to parse file: file:///src/app/main.go.
ERROR: Cannot parse 'app/main.go': Go parser external process returned non-zero exit value: 126
ERROR: Unable to parse file: file:///src/app/server/http_server.go.
ERROR: Cannot parse 'app/server/http_server.go': Go parser external process returned non-zero exit value: 126
ERROR: Unable to parse file: file:///src/app/infra/logger.go.
ERROR: Cannot parse 'app/infra/logger.go': Go parser external process returned non-zero exit value: 126

Uploaded the image for the Latest for the same


Could you please help

Hi everyone,

Our Go analyzer does currently not support Linux ARM64. Only MacOS ARM64 is supported, which was added by the ticket linked by @Colin (SONARSLANG-589).

Support for Linux ARM64 can also be added in a similar way, I created a ticket SONARSLANG-639 for that.

The reason why it’s not working ootb is that not the Go parser available on the build machine (if any) is used by our Go analyzer, but the binaries for the Go parser are shipped with the Jar of the analyzer. Currently supported platforms are:

  • Windows AMD64
  • Linux AMD64
  • MacOS AMD64
  • MacOS ARM64

Cheers,
Marco

:face_with_thermometer:I’m experiencing the same issue and waiting for the upcoming Linux ARM64 GO parser support. Any update 1 month later?

Hi @INT_MAX,

Welcome to the community!

Feel free to keep an eye on the ticket linked above.

 
HTH,
Ann

Hi! I do see the ticket, but it was not updated since Dec. 4th, 2023. That’s why I’m asking. :wink: I’ll definitely watch that ticket anyway. Thanks!

I am still facing this issue as well on 10.5.1-community. The funny history is that the scan is fixed for Mac M1, and the solution seems to be very similar to Linux. There is no news here about the fix. What is missing to you guys apply the fix to ARM Linux?