-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: build fails when run via QEMU for linux/amd64 running on linux/arm64 #69255
Comments
I agree, it looks quite different. #68976 is very specific to pidfd use in os/syscall. This looks like some form of corruption. Do you know if this build is running a full Linux kernel in a VM, or using QEMU user mode Linux emulation? |
Notice
This seems like a sign extension issue when right shifting the packed value (See https://cs.opensource.google/go/go/+/master:src/runtime/lfstack.go;l=26-30, specifically I could imagine this being a code generation issue, or an issue in QEMU instruction emulation. cc @golang/compiler |
Does the same issue occur on Go 1.22? |
Yes. Indeed similar looking stacks for 1.21.13, 1.22.6, 1.23.0. Confirmed via:
|
I'm miles out of my depth here, but in case this is useful:
|
... but just to be super clear, I'm doing this via Docker: https://docs.docker.com/build/building/multi-platform/#qemu (so I'm actually unsure whether the host system |
I will see if I can reproduce when I get a chance. As a workaround, do you actually need to do linux-amd64 builds via QEMU emulation? Go can cross-compile on its own well, though perhaps you have cgo dependencies that make it difficult? |
We did end up with a two-stage Dockerfile where the builder is on the host platform, cross-compiles to the target platform without cgo, and then the second stage builds an image for the target platform. So while we are not blocked by this bug as there's a workaround, it's probably worth keeping it open for a fix. |
Go version
go version go1.23.0 linux/arm64
Output of
go env
in your module/workspace:What did you do?
Given:
Running:
What did you see happen?
My setup here is my host machine is
linux/arm64
, Qemu installed, following the approach described at https://docs.docker.com/build/building/multi-platform/#qemu, to build forlinux/amd64
.This has definitely worked in the past which leads me to suggest that something other than Go has changed/been broken here. However I note the virtually identical call stack reported in #54104 hence raising here in the first instance.
What did you expect to see?
Successful run of
docker build
.The text was updated successfully, but these errors were encountered: