-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 sometimes hangs under qemu-arm-static since 1.21 #67355
Comments
In my experience QEMU was always very buggy, we also don't have a builder setup for qemu so we can't make any promises about compatibility. See the porting policy. I'm not sure if we can do anything about this. cc @golang/runtime |
qemu has made real progress, and while it's true there were many bugs when I previously had used it ~10 years ago, these past few years the only problems I see are with go, and until 1.21 they were easy to ignore (rare, and while ugly just shoving the whole build script in a retry loop was good enough) I'm not asking for stability promises or any fix here, just some direction to help debug this -- it's entirely possible the fix would go into qemu side, but I can't do anything if I don't understand what goes wrong in the first place... I guess that since I can build a broken version I can sparkle print statements and see where it hangs, but given it looks like a race and I can't reproduce with strace it's likely print statements will also make it go away.
Thanks! |
Grmpf. A coworker reported another problem with our armv7 builder and upon further inspection the binfmt entry for qemu-arm was weird (as in, different from some other debian system when I couldn't reproduce the unsupported syscall that came up in new error):
instead of:
(P flag to preserve argv0 of the emulated binary and interpreter path changed) After fixing this I noticed qemu-arm-static has a So that would be an issue related to how qemu is registered, I guess? And I got confused because the go version update matches the update in alpine from our last builds when I couldn't reproduce this, and older go didn't exhibit the hang, so this was all weird... Either way, go's change of behavior probably really exists and could likely be tracked down if I had time to get back to the old binfmt registered back, but I'll skip this exercise for now -- I'll reopen this or open a new issue if something similar turns up. Thanks for the quick reply anyhow! (by the way, the segfault I was seeing occasionally also seemingly stopped reproducing, so qemu-user must have improved in the past couple of years and actually does even better than I was expecting now it's properly setup...) |
For future reference, if you set GOTRACEBACK=crash, the signal handler will explicitly send a signal to every thread to dump its own stack, which should get you a stack from the running goroutine. |
Go version
go version devel go1.23-8623c0ba95 Mon May 13 21:47:29 2024 +0000 linux/arm
Output of
go env
in your module/workspace:What did you do?
apt install qemu-user-static binfmt
on debian$ docker run --rm -ti docker.io/arm32v7/alpine:latest
/ # apk add go
/ # for i in $(seq 1 100); do go env GOPATH; done
What did you see happen?
go gets stuck about 1 in 10 runs
(I wasn't sure if I should have commented on #1508 but it's a new regression so figured it'd be easier to discuss separately)
Some more facts:
taskset -c 1
-- can we get useful out of that pc perhaps?
I'm honestly not familiar with go at all, but I can probably find my way - I'll probably keep digging a bit trying to build a "good" version so I can bisect, but if there's a more straightforward way to get the running stack trace I'll be happy to try messing around that part of the code.
Thanks!
What did you expect to see?
go doesn't get stuck.
The text was updated successfully, but these errors were encountered: