-
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: qemu-arm fails to emulate go user programs #13024
Comments
/cc @minux who wrote CL 124900043. I'm not sure how/why that code got lost/reverted. It seems fine to put in again. |
CL https://golang.org/cl/16853 mentions this issue. |
Could this be backported to 1.5.2 ? |
Probably not critical enough, we never supported
running binaries under qemu user emulation before.
|
@davecheney, if you can make a case for why it's important, it's certainly
simple enough that I am OK with putting it in 1.5.2.
|
Thanks @rsc. Canonical have gone through a lot of internal bureaucratic pain to get up to Go 1.5, if this patch could make it into 1.5.2 that would be much appreciated. |
👍 for the patch thanks |
No released Go version has had this patch, as far as I understand. Go 1.5.2 should be out by the end of the calendar year, probably sooner. |
AIUI the fix was committed to the C version of the runtime on the dev.power64, but I don't think it ever got to master. Perhaps it got lost as part of the transition of the runtime to pure go? Doesn't really matter now anyway. |
CL https://golang.org/cl/16986 mentions this issue. |
…r SIGRTMAX A forward port of https://codereview.appspot.com/124900043/ which somehow got lost somewhere. Fixes #13024 Change-Id: Iab128899e65c51d90f6704e3e1b2fc9326e3a1c2 Reviewed-on: https://go-review.googlesource.com/16853 Reviewed-by: Russ Cox <[email protected]> Reviewed-on: https://go-review.googlesource.com/16986 Run-TryBot: Austin Clements <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
@streamnsight FWIW I originally reproduced this issue in go1.5.1 |
I compiled a binary on ARM (
I'm using https://github.com/moul/docker-binfmt-register for running ARM docker images on |
@luxas this is probably a different issue. Please open a new issue, but note that qemu is not reliable when running go programs. qemu's emulation is too glibc specific. |
Yep, I'm fine with creating a new issue. Just said it here first, so you guys know about it. |
Yeah, I think we lost the ability to run Go binaries with
qemu-arm long time ago. tcg fatal error also seems to
suggest that it's a qemu bug. (the arm port used to be
developed with qemu-arm, but then as the port is able
to run on real hardwares, we no longer test on qemu-arm.)
The signal patch is originally intended for qemu-ppc64,
btw. I doubt that even qemu-ppc64 is able to run Go
binaries, other than the most trivial one.
As beefy arm boards are widely available, I don't think
we should invest into qemu usermode emulation any
more. It's slower than the more powerful arm boards,
and it doesn't support multithreaded programs well.
|
qemu-arm fails to emulate go user programs due to how qemu handles certain signals.
The original issue/diff that seems to solve the issue is here:
https://codereview.appspot.com/124900043/diff/60001/src/pkg/runtime/os_linux.c
The qemu code is here:
http://git.qemu.org/?p=qemu.git;a=blob;f=linux-user/signal.c;h=1141054be2170128d6f7a340b41484b49a255936;hb=HEAD#l82
Test Case:
Build this on an non-arm platform such as x86.
test.go:
This will fail with the following error:
Testing with the aforementioned patch solves the issue, but I'm unsure its the best approach to solving this. I can re-propose that patch if there isn't a better solution, but this would be a very useful feature for using qemu user space emulation with go.
--chris
The text was updated successfully, but these errors were encountered: