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

cgocall unavailable without CGO_ENABLED=0 #2

iamacarpet opened this issue May 15, 2019 · 1 comment


None yet
2 participants
Copy link

commented May 15, 2019

Hello @notti

Just finishing up my documentation and I noticed in yours it says:

WARNING nocgo supports both cgo and missing cgo as environment. So if you want to ensure cgo not being used don't forget CGO_ENABLED=0 as environment variable to go build.

However, building without CGO_ENABLED=0 always throws me this error:

fatal error: cgocall unavailable

goroutine 1 [running, locked to thread]:
runtime.throw(0x4f53b4, 0x13)
        /usr/local/go/src/runtime/panic.go:617 +0x72 fp=0xc000090d50 sp=0xc000090d20 pc=0x429d02
runtime.cgocall(0x4a8ed0, 0xc000090d98, 0xc000090db8)
        /usr/local/go/src/runtime/cgocall.go:96 +0xe4 fp=0xc000090d88 sp=0xc000090d50 pc=0x403d34, 0x10, 0x10, 0xc000000002, 0xf, 0x10, 0x7fbff35f9d98, 0x0, 0xaa, 0xc000090f38, ...)
        ~/go-projects/src/ +0x49 fp=0xc000090db8 sp=0xc000090d88 pc=0x4a8ea9, 0xf, 0x40b768, 0x70, 0x4e6f60)
        ~/go-projects/src/ +0x84 fp=0xc000090e10 sp=0xc000090db8 pc=0x4a7f54
        ~/go-projects/src/ +0x4b fp=0xc000090f48 sp=0xc000090e10 pc=0x4ac4cb
        ~/go-projects/src/ +0x22 fp=0xc000090f78 sp=0xc000090f48 pc=0x4ad9e2
        <autogenerated>:1 +0x93 fp=0xc000090f88 sp=0xc000090f78 pc=0x4b3a33
        <autogenerated>:1 +0x54 fp=0xc000090f98 sp=0xc000090f88 pc=0x4b4654
        /usr/local/go/src/runtime/proc.go:188 +0x1c8 fp=0xc000090fe0 sp=0xc000090f98 pc=0x42b628
        /usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc000090fe8 sp=0xc000090fe0 pc=0x454c71

Is this expected behavior?



This comment has been minimized.

Copy link

commented May 17, 2019

Ah you managed to hit an untested path. So far I only tested with something that uses network functions which includes cgo if not explicitly asked not to do that...
I'll try to fix that if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.