balena-io / qemu

QEMU with additional QEMU_EXECVE flag that persists emulator after an execve
Other
62 stars 28 forks source link

Running resin-xbuild on a Qemu aarch64 environment returns an error #14

Closed julianxhokaxhiu closed 6 years ago

julianxhokaxhiu commented 7 years ago

Hi,

I was trying to run the resin-xbuild binary ( compiled from source[1] in a native aarch64 platform, rpi3 in my case ) inside a qemu aarch64 environment, but every time I try to do so I get this error:

[root@dev ~]# ./resin-xbuild
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0xd1d4d, 0x9)
        /usr/lib/go/src/runtime/panic.go:596 +0x70
runtime.newosproc(0x14420026000, 0x14420036000)
        /usr/lib/go/src/runtime/os_linux.go:163 +0x168
runtime.newm(0xd8740, 0x0)
        /usr/lib/go/src/runtime/proc.go:1628 +0x110
runtime.main.func1()
        /usr/lib/go/src/runtime/proc.go:126 +0x28
runtime.systemstack(0x143200)
        /usr/lib/go/src/runtime/asm_arm64.s:241 +0x90
runtime.mstart()
        /usr/lib/go/src/runtime/proc.go:1132

goroutine 1 [running]:
runtime.systemstack_switch()
        /usr/lib/go/src/runtime/asm_arm64.s:190 +0x8 fp=0x14420022780 sp=0x14420022770
runtime.main()
        /usr/lib/go/src/runtime/proc.go:127 +0x58 fp=0x144200227d0 sp=0x14420022780
runtime.goexit()
        /usr/lib/go/src/runtime/asm_arm64.s:981 +0x4 fp=0x144200227d0 sp=0x144200227d0

I am also trying to replicate your cross-build instructions on Docker Hub for this platform ( as it is working very fine for armv7 ), and you can see that also here it brings an error: https://hub.docker.com/r/julianxhokaxhiu/gogs/builds/bb2txbjdwsd4nn3awkzyala/

Any idea if this comes from Go or your qemu binary?

Thank you in advance, Julian


[1] Here you can find the binary, the source code and your static binary ( I'm using the latest available in your release ): https://github.com/julianxhokaxhiu/gogs/tree/aarch64/docker/aarch64

willnewton commented 7 years ago

It's possible you're running into this issue:

https://bugs.launchpad.net/qemu/+bug/1696353

The two workarounds are:

  1. Patch/downgrade qemu
  2. Upgrade to trunk Go
julianxhokaxhiu commented 6 years ago

Hi,

I've tried to use the release 2.9.0 on your side + golang 1.9.2 and still I have the same issue. I will retry with go 1.10 as soon as it is released. Hopefully ( maybe ) that will fix it.

Have you got any other idea in case?

Thank you in advance, Julian

julianxhokaxhiu commented 6 years ago

Tested with Go 1.10 and it worked successfully :)

https://hub.docker.com/r/julianxhokaxhiu/gogs/builds/bohhlsyxxpb82g3sh4lmqga/

Thanks for all the support!