Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
runtime: qemu-arm fails to emulate go user programs #13024
Comments
rakyll
changed the title from
qemu-arm fails to emulate go user programs
to
runtime: qemu-arm fails to emulate go user programs
Oct 22, 2015
|
/cc @minux who wrote CL 124900043. I'm not sure how/why that code got lost/reverted. It seems fine to put in again. |
rsc
added this to the Go1.6 milestone
Oct 23, 2015
gopherbot
commented
Nov 12, 2015
|
CL https://golang.org/cl/16853 mentions this issue. |
rsc
closed this
in
d106750
Nov 12, 2015
|
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. |
rsc
modified the milestones:
Go1.5.2,
Go1.6
Nov 12, 2015
streamnsight
commented
Nov 16, 2015
|
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. |
streamnsight
referenced this issue
in luxas/kubernetes-on-arm
Nov 16, 2015
Closed
question: how does it work? #16
streamnsight
commented
Nov 16, 2015
|
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. |
gopherbot
commented
Nov 16, 2015
|
CL https://golang.org/cl/16986 mentions this issue. |
added a commit
that referenced
this issue
Nov 17, 2015
arges
commented
Nov 17, 2015
|
@streamnsight FWIW I originally reproduced this issue in go1.5.1 |
This was referenced Nov 19, 2015
luxas
commented
Dec 15, 2015
|
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. |
luxas
commented
Dec 15, 2015
|
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.
|
arges commentedOct 22, 2015
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