-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: Segfault on ppc64le during Go 1.18 build on Alpine Linux #51787
Comments
One thing that changed for ppc64le in 1.18 is that it now uses the new register abi. You could disabling it by setting a |
Thanks for your suggestion, unfortunately it still segfaults with that environment variable set. |
Thanks for trying. AFAIK we don't have an Alpine or a musl builder1, so some breakage seems inevitable. Some would say that any platform we don't have a builder for is not officially supported. Footnotes
|
Apart from the cgo tests (#39857) we didn't have any major issues with Go and its test suite in the past years. I think that a Go builder for Alpine/musl would be nice, let me know if I can be of assistance in that regard. |
cc @laboger |
When the musl linker starts the go binary, it seems to be passing argc/argv/env through the stack, and the pointers r3/r4/r5 do not contain these pointers as go expects, nor is r4 0. |
cmd/go is linking with the internal linker on 1.18 now, I suspect musl needs its startup code linked when using cgo+internal linking. I am not entirely sure how glibc gets away without it. |
The call from musl's loader into the program vs glibc's is different on ppc64le. Explicitly requesting external linking mode will avoid this. Is there an option to do this without forcing external linking of pure go binaries? |
User could pass |
This is a workaround for an upstream Go issues. Some tests fail as they also try to use internal link mode, since this is (hopefully) a temporary workaround just disable tests on ppc64le for now. See golang/go#51787 (comment)
I can confirm that forcing external link mode via |
Change https://go.dev/cl/394654 mentions this issue: |
@gopherbot please consider this for backport to 1.18, it is a severe bug for alpine. |
Backport issue(s) opened: #51874 (for 1.18). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
With Go 1.18.1 the Go build succeeds and the test (with the exception of the cgo stuff due to #39857) pass successfully on ppc64le musl. However, we are seeing a lot of build/linking failures of Go packages on ppc64le. They often look as follows (and don't happen on other architectures):
or:
Example build logs: Do you want me to open a separate issue for this or can this issue be reopened? |
I think this is a separate issue. I would prefer a separate issue. Thanks. |
Yeah, it is probably better as a separate issue. @nmeum when you open a new issue, could you include the command you used to run "go build"? Thanks. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Since the Go build itself fails, I cannot provide this information. I am using Alpine Linux Edge (which uses musl libc) on ppc64le. I added the
go env
output for Go 1.17 (which compiles fine on ppc64le Alpine Linux Edge) below.go env
OutputWhat did you do?
I am working on upgrading the Alpine Linux Go package from 1.17.8 to 1.18. While doing so, I noticed that 1.18 fails to compile on our ppc64le CI. On all other architectures supported by Alpine (aarch64, armhf, armv7, s390x, x86 and x86_64) Go 1.18 builds fine and passes all tests. I would also like to point out that Go 1.17.8 compiles fine and passes tests on ppc64le Alpine Linux.
I assume the Go 1.18 build has been tested on a glibc-based Linux system before? For this reason, I suspect that this might be related to musl libc. In order to reproduce this issue it should be sufficient to run
./make.bash
on a ppc64le-based Alpine Linux Edge system (see our build receipe for details).What did you expect to see?
A successful Go build.
What did you see instead?
A segfault while compile
cmd/go
:Full build log with
./make.bash -v
from our Alpine ppc64le CI: alpine-linux-edge-ppc64le-go-1.18.txtSince Go 1.17.8 builds fine, I think this a regression introduced in Go 1.18. Any ideas what might be causing this?
The text was updated successfully, but these errors were encountered: