Skip to content
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

failed to create new OS thread (have 2 already; errno=22) #93

Closed
ciaranmcnulty opened this issue Oct 6, 2021 · 7 comments
Closed

failed to create new OS thread (have 2 already; errno=22) #93

ciaranmcnulty opened this issue Oct 6, 2021 · 7 comments

Comments

@ciaranmcnulty
Copy link

I'm trying to build https://github.com/rodolpheche/wiremock-docker multi-arch from my M1 Mac.

The amd64 build gets the following error:

 RUN gosu nobody true:
#6 0.088 runtime: failed to create new OS thread (have 2 already; errno=22)
#6 0.088 fatal error: newosproc
#6 0.091 
#6 0.091 runtime stack:
#6 0.092 runtime.throw(0x4cb21f, 0x9)
#6 0.092        /usr/local/go/src/runtime/panic.go:566 +0x95
#6 0.092 runtime.newosproc(0xc420026000, 0xc420035fc0)
#6 0.092        /usr/local/go/src/runtime/os_linux.go:160 +0x194
#6 0.092 runtime.newm(0x4d6db8, 0x0)
#6 0.092        /usr/local/go/src/runtime/proc.go:1572 +0x132
#6 0.092 runtime.main.func1()
#6 0.092        /usr/local/go/src/runtime/proc.go:126 +0x36
#6 0.092 runtime.systemstack(0x53ae00)
#6 0.092        /usr/local/go/src/runtime/asm_amd64.s:298 +0x79
#6 0.093 runtime.mstart()
#6 0.093        /usr/local/go/src/runtime/proc.go:1079
#6 0.093 
#6 0.093 goroutine 1 [running]:
#6 0.093 runtime.systemstack_switch()
#6 0.093        /usr/local/go/src/runtime/asm_amd64.s:252 fp=0xc420020768 sp=0xc420020760
#6 0.093 runtime.main()
#6 0.093        /usr/local/go/src/runtime/proc.go:127 +0x6c fp=0xc4200207c0 sp=0xc420020768
#6 0.093 runtime.goexit()
#6 0.093        /usr/local/go/src/runtime/asm_amd64.s:2086 +0x1 fp=

I'm sure this is somehow caused by Qemu but thought I'd check here if there's any way of resolving?

@tianon
Copy link
Owner

tianon commented Oct 6, 2021

Yeah, this is definitely caused by QEMU's user-mode emulation, which Go unfortunately doesn't officially support. 😞

(I'm not aware of anything that can be done here to fix it.)

@ciaranmcnulty
Copy link
Author

Guess I need to look at other options - thanks for the quick response!

@pramttl
Copy link

pramttl commented Oct 21, 2021

This probably needs to be reopened so someone can suggest a solution for this. I ran into this on Mac M1 too.

@ciaranmcnulty
Copy link
Author

It may be something to raise upstream with Qemu or Go?

@ciaranmcnulty
Copy link
Author

Actually... updating to gosu 1.14 has fixed this in my case I think

@huapox

This comment was marked as outdated.

@tianon

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants