-
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
runtime: Go 1.22.0 fails to build from source on armv7 Alpine Linux #65601
Comments
CC @golang/arm. |
Are these bare metal or cross arch virtualized machines? |
Thank for the report. Would it be okay for you to do a bisection? Thanks. |
These are armv7 Docker containers running on an aarch64 host.
I am currently somewhat short-pressed on time, but I will try to look into it. |
The commit which introduced the regression is 66b8107 (CC: @randall77). Reverting this commit fixes the build. |
It might be an interesting interaction between CL 525637 and CL 514907. Specifically, this code https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/work/gc.go;l=369-381 is defining assembler macros Could you try if CL https://go.dev/cl/562995 helps? Thanks. |
Change https://go.dev/cl/562995 mentions this issue: |
Still deadlocks with this patch. |
Thanks. I updated the CL. Could you try the new version of the CL? It seems we also need to define GOARM_x in cmd/dist. |
Thanks for the patch. Unfortunately, it still deadlocks for me with the updated version of the CL. |
Change https://go.dev/cl/564855 mentions this issue: |
Thanks. Could you try https://go.dev/cl/564855 ? That should fix the build. |
…/hardfloat CL 525637 added GOARM_x assembly macros based on GOARM value. But it did not define the macro in cmd/dist, so the macro is not set during bootstrapping. This CL defines them. With CL 514907, cfg.GOARM can also take a soft/hardfloat suffix, like "7,hardfloat". Handle that case. For #65601. Change-Id: I60ffe7e8b623ae693d91d6e8595067a6f76565b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/562995 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot please backport this to Go 1.22 release. This is a regression, causing runtime crashes with GOARM=7. |
Backport issue(s) opened: #65760 (for 1.22). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Bug: golang/go#65601 Bug: https://bugs.gentoo.org/924649 Signed-off-by: Sam James <sam@gentoo.org>
It needs broken-on-arm >=dev-lang/go-1.22.0 and 1.22.0 is the only version matching that. Bug: golang/go#65601 Bug: https://bugs.gentoo.org/924649 Bug: https://bugs.gentoo.org/924744 Signed-off-by: Sam James <sam@gentoo.org>
CL 525637 changed to the guard of DMB instruction from the compiled-in runtime.goarm value to GOARM_7 macro and CPU feature detection. It missed a place where runtime.goarm is loaded to a register and reused later. This CL corrects the condition. Fixes golang#65601. Change-Id: I2ddefd03a1eb1048dbec0254c6e234c65b054279 Reviewed-on: https://go-review.googlesource.com/c/go/+/564855 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
…/hardfloat CL 525637 added GOARM_x assembly macros based on GOARM value. But it did not define the macro in cmd/dist, so the macro is not set during bootstrapping. This CL defines them. With CL 514907, cfg.GOARM can also take a soft/hardfloat suffix, like "7,hardfloat". Handle that case. For golang#65601. Change-Id: I60ffe7e8b623ae693d91d6e8595067a6f76565b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/562995 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
[ commit fc4a497e2990cc62ac8bef5ce8f41a906d990b73 ] See golang/go#65601
Change https://go.dev/cl/567555 mentions this issue: |
…d at a DMB instruction CL 525637 changed to the guard of DMB instruction from the compiled-in runtime.goarm value to GOARM_7 macro and CPU feature detection. It missed a place where runtime.goarm is loaded to a register and reused later. This CL corrects the condition. Updates #65601. Fixes #65760. Change-Id: I2ddefd03a1eb1048dbec0254c6e234c65b054279 Reviewed-on: https://go-review.googlesource.com/c/go/+/564855 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit a0226c5) Reviewed-on: https://go-review.googlesource.com/c/go/+/567555 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Bypass: Carlos Amedee <carlos@golang.org>
…d at a DMB instruction CL 525637 changed to the guard of DMB instruction from the compiled-in runtime.goarm value to GOARM_7 macro and CPU feature detection. It missed a place where runtime.goarm is loaded to a register and reused later. This CL corrects the condition. Updates golang#65601. Fixes golang#65760. Change-Id: I2ddefd03a1eb1048dbec0254c6e234c65b054279 Reviewed-on: https://go-review.googlesource.com/c/go/+/564855 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit a0226c5) Reviewed-on: https://go-review.googlesource.com/c/go/+/567555 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Bypass: Carlos Amedee <carlos@golang.org>
…d at a DMB instruction CL 525637 changed to the guard of DMB instruction from the compiled-in runtime.goarm value to GOARM_7 macro and CPU feature detection. It missed a place where runtime.goarm is loaded to a register and reused later. This CL corrects the condition. Updates golang#65601. Fixes golang#65760. Change-Id: I2ddefd03a1eb1048dbec0254c6e234c65b054279 Reviewed-on: https://go-review.googlesource.com/c/go/+/564855 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit a0226c5) Reviewed-on: https://go-review.googlesource.com/c/go/+/567555 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Bypass: Carlos Amedee <carlos@golang.org>
@cherrymui It seems that your backport was incomplete. Commit e4ebd13 of CL562995 has not been backported, but seems to be required to fix the build. As is, Go 1.22.3 doesn't build on armv7 FreeBSD. Could you backport the missing commit, too? |
@clausecker thanks for reporting. I thought that CL 562995 is nice to have to but not a requirement: if the macro is not defined correctly it just builds a binary that is not optimized for GOARM=7. It is possible I missed something. What is the error you saw? Thanks. |
@cherrymui I get crashes and hangs that look very similar to what @nmeum saw. A bisection led me to 6ecadb4 for the first commit where this happens (may be incorrect) and to e4ebd13 for where this behaviour ceases. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278953 for where I track the build failure in our port. |
This backports a commit needed to get proper barriers during bootstrap when building Go with more than one job on armv7. Note that this only changes the behaviour when building the bootstrap toolchain. Binaries generated using the toolchain are not affected and hence Go ports need not be bumped. PR: 278953 Approved by: portmgr (build fix blanket) Obtained from: https://go-review.googlesource.com/c/go/+/562995 See also: golang/go#65601 MFH: 2024Q2
This backports a commit needed to get proper barriers during bootstrap when building Go with more than one job on armv7. Note that this only changes the behaviour when building the bootstrap toolchain. Binaries generated using the toolchain are not affected and hence Go ports need not be bumped. PR: 278953 Approved by: portmgr (build fix blanket) Obtained from: https://go-review.googlesource.com/c/go/+/562995 See also: golang/go#65601 MFH: 2024Q2 (cherry picked from commit 1ec5017)
Go version
N/A
Output of
go env
in your module/workspace:What did you do?
I maintain the Go package for Alpine Linux, this package builds Go from source using
./make.bash
.While upgrading from Go 1.21.6 to Go 1.22.0 we noticed that Go itself wouldn't build on our armv7 CI.
What did you see happen?
Go 1.22.0 builds successful on Alpine x86_64, x86, armhf (
GOARM=6
), ppc64le, aarch64 and riscv64. It only fails to build on armv7 (GOARM=7
). Furthermore, Go 1.21.6 builds fine on our armv7 CI. Therefore, I believe this to be a regression in Go 1.22.0. The build failure message is not consistent, there is probably a race condition somewhere. However, it always fails either afterBuilding Go toolchain2 using go_bootstrap and Go toolchain1
orBuilding Go toolchain3 using go_bootstrap and Go toolchain2
.Build logs of some of the failures we have seen so far (as I said, the exact error message differs):
SIGSEGV: segmentation violation
: alpine-edge-armv7-go-failure-sigsev.txtfatal error: checkdead: runnable g
: alpine-edge-armv7-go-failure-checkdead.txtSIGILL: illegal instruction
: alpine-edge-armv7-go-failure-sigill.txtBuilding Go toolchain2 using go_bootstrap and Go toolchain1
.Any idea what might be causing this? Any hints on debugging this further?
What did you expect to see?
A successful build of Go 1.22.0 on all architectures.
The text was updated successfully, but these errors were encountered: