Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: A QEMU signaling fix causes Go binaries to fail on startup. #33746
tl;dr: In anticipation of a future QEMU work-around, Go should hide runtime
QEMU user mode emulation has a bug where it will not correctly deliver the
On startup, the Go attempts to register signal handlers for all signals, but it silently hides failures for
If Go decides to preemptively fix this issue, the patch is simple: just ignore failures for signal
Is there a more robust way to handle this issue? From the signal(7) manpage http://man7.org/linux/man-pages/man7/signal.7.html:
Which says values 63 and 64 that qemu ends up using in the common case when SIGRTMAX==64 shouldn't be hardcoded.
I'm bringing it up because currently Go programs compiled for linux/mips (mips mipsle mips64 mips64le) fail on startup running in qemu user mode on most architectures (amd64 etc.) due to a related issue. The go compiler hardcodes that realtime signals go up to 128 on linux/mips (implicitly that SIGRTMAX==128 on linux/mips https://github.com/golang/go/blob/77f9b2728eb08456899e6500328e00ec4829dddf/src/runtime/sigtab_linux_mipsx.go) and on startup sigaction on 65 and above fail on amd64 etc. It would be nice to have a solution general enough to allow mips programs to run under qemu user mode as well.