-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: illegal instruction in cgo call mygetgrgid_r on arm (cross) #28642
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
Comments
Here is the /proc/cpuinfo:
|
Cross compiler information (CC and CXX)
|
Go is compiled with:
|
Can you disassemble the binary and show us the instructions around PC=0x4f64e? |
Reproduced against go 1.10.3 .... Really starting to look like this may not be a Go specific issue, but I don't know where else to start looking yet (maybe the toolchain?) This build, I ensured that CC_FOR_TARGET=$(CC) and CXX_FOR_TARGET=$(CXX) when cross-compiling.
The disassembly around 5152c:
Done using the toolchain objdump. I see UNDEFINED instruction here a lot, are these causing the SIGILL? Will try with the CL patched in. |
Looks like you disassembled in thumb mode. We generate only standard arm code. Could you figure out how to disassemble in standard mode? |
@randall77 In Buildroot we compile with thumb2 enabled on ARM. Would this break everything if the thumb mode was disabled when Go was calling the CC, or also if anything in the shared libraries used was in thumb2? |
@randall77 That CL doesn't apply to this scenario, it's for arm64 (this is arm) and for android (this is GOOS=linux) |
I don't know much about arm <-> thumb transitions, just a suspicion based on the fact that the disassembler chose thumb.
Ok. It's possibly a related issue, as we do use some feature detection to enable instructions on arm as well. I think we do it for the hardware divide instruction, at least. But that seems an unlikely culprit at the moment. |
Crash at PC=0x127d4 (cgocall.go:128) go 1.11.2
Maybe |
|
Okay, disabling static compilation of the binary fixes the issue. I'm going to go ahead and close this, it's probably related to mixing thumb2 and standard instructions with static compilation. Going to give up on having a static docker client for now. |
golang/go#28642 🤷 Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
Background info
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. Reproduce by compiling dockerd with:
The Docker daemon initially works correctly on the target system, but if you run "docker build ." the cgo call mygetgrgid_r causes the SIGILL.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Note: this bug only happens if the FROM declaration in the Dockerfile specifies a docker image that does not currently exist on the system (the cgo call must happen during the image pull phase).
What did you expect to see?
Program runs correctly
What did you see instead?
SIGILL illegal instruction
The text was updated successfully, but these errors were encountered: