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

runtime: go build panicked with "non-Go code disabled sigaltstack" #16468

Closed
ahmetb opened this issue Jul 22, 2016 · 6 comments

Comments

Projects
None yet
7 participants
@ahmetb
Copy link

commented Jul 22, 2016

Please answer these questions before submitting your issue. Thanks!

1. What version of Go are you using (go version)?

go version go1.6.2 darwin/amd64

2. What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.6.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.6.2/libexec/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

3. What did you do?

First of all I was not able to reproduce this error ever again It was an one-off thing and when I googled the error only the source code came up, so reporting.

It occurred when I was doing go build on(&to) darwin/amd64.

4. What did you expect to see?

go build to work.

5. What did you see instead?

$ go build
signal 28 received on thread with no signal stack
fatal error: non-Go code disabled sigaltstack

goroutine 17 [running, locked to thread]:
runtime.throw(0x6756a0, 0x20)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/panic.go:547 +0x90 fp=0xc82003aec8 sp=0xc82003aeb0
runtime.noSignalStack(0xc80000001c)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/signal1_unix.go:300 +0x84 fp=0xc82003aee0 sp=0xc82003aec8
runtime.call32(0x0, 0xc8204c43d0, 0xc8204c4474, 0x4)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/asm_amd64.s:472 +0x3e fp=0xc82003af08 sp=0xc82003aee0
runtime.cgocallbackg1()
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/cgocall.go:267 +0x10c fp=0xc82003af40 sp=0xc82003af08
runtime.cgocallbackg()
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/cgocall.go:180 +0xd7 fp=0xc82003afa0 sp=0xc82003af40
runtime.cgocallback_gofunc(0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/asm_amd64.s:716 +0x60 fp=0xc82003afb0 sp=0xc82003afa0
runtime.goexit()
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc82003afb8 sp=0xc82003afb0

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc82047f4dc)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/sema.go:47 +0x26
sync.(*WaitGroup).Wait(0xc82047f4d0)
    /usr/local/Cellar/go/1.6.2/libexec/src/sync/waitgroup.go:127 +0xb4
main.(*builder).do(0xc8201769a0, 0xc8201acc30)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1323 +0x3c6
main.runBuild(0x888ae0, 0xc82000a370, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:479 +0x4dc
main.main()
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/main.go:181 +0x783

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/sigqueue.go:116 +0x132
os/signal.loop()
    /usr/local/Cellar/go/1.6.2/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/Cellar/go/1.6.2/libexec/src/os/signal/signal_unix.go:28 +0x37

goroutine 8 [running]:
    goroutine running on other thread; stack unavailable
created by main.(*builder).do
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1320 +0x39e

goroutine 9 [syscall]:
syscall.Syscall6(0x7, 0x1246e, 0xc8204c2dcc, 0x0, 0xc820405ef0, 0x0, 0x0, 0xc8204c2da8, 0xdef30, 0xc8204c2da0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/asm_darwin_amd64.s:41 +0x5
syscall.wait4(0x1246e, 0xc8204c2dcc, 0x0, 0xc820405ef0, 0x90, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/zsyscall_darwin_amd64.go:34 +0x7f
syscall.Wait4(0x1246e, 0xc8204c2e14, 0x0, 0xc820405ef0, 0xc82012c700, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/syscall_bsd.go:129 +0x55
os.(*Process).wait(0xc8200fc400, 0x2e, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec_unix.go:22 +0x105
os.(*Process).Wait(0xc8200fc400, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/doc.go:49 +0x2d
os/exec.(*Cmd).Wait(0xc82029b180, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:396 +0x211
os/exec.(*Cmd).Run(0xc82029b180, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:262 +0x64
main.(*builder).runOut(0xc8201769a0, 0xc82040fac0, 0x33, 0xc82029edc1, 0xc, 0x0, 0x0, 0x0, 0xc82047d760, 0x10, ...)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:2049 +0x364
main.gcToolchain.gc(0xc8201769a0, 0xc8203dcc00, 0xc82041cea0, 0x51, 0xc82041cde0, 0x55, 0x0, 0xc8200fc020, 0x2, 0x2, ...)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:2310 +0x1261
main.(*gcToolchain).gc(0x8acf60, 0xc8201769a0, 0xc8203dcc00, 0xc82041cea0, 0x51, 0xc82041cde0, 0x55, 0x0, 0xc8200fc020, 0x2, ...)
    <autogenerated>:3 +0x18e
main.(*builder).build(0x10b59c, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1484 +0x224c
created by main.(*builder).do
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1320 +0x39e

goroutine 10 [syscall]:
syscall.Syscall6(0x7, 0x1245f, 0xc8204aadcc, 0x0, 0xc8203039e0, 0x0, 0x0, 0xc8204aada8, 0xdef30, 0xc8204aada0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/asm_darwin_amd64.s:41 +0x5
syscall.wait4(0x1245f, 0xc8204aadcc, 0x0, 0xc8203039e0, 0x90, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/zsyscall_darwin_amd64.go:34 +0x7f
syscall.Wait4(0x1245f, 0xc8204aae14, 0x0, 0xc8203039e0, 0xc8204fe530, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/syscall_bsd.go:129 +0x55
os.(*Process).wait(0xc8203491c0, 0x2e, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec_unix.go:22 +0x105
os.(*Process).Wait(0xc8203491c0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/doc.go:49 +0x2d
os/exec.(*Cmd).Wait(0xc820427680, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:396 +0x211
os/exec.(*Cmd).Run(0xc820427680, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:262 +0x64
main.(*builder).runOut(0xc8201769a0, 0xc8200b0a50, 0x2a, 0xc8201fe871, 0x3, 0x0, 0x0, 0x0, 0xc82018bb80, 0x3d, ...)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:2049 +0x364
main.gcToolchain.gc(0xc8201769a0, 0xc8202a3400, 0xc8203edb80, 0x48, 0xc8203eda90, 0x4c, 0x0, 0xc820370fa0, 0x2, 0x2, ...)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:2310 +0x1261
main.(*gcToolchain).gc(0x8acf60, 0xc8201769a0, 0xc8202a3400, 0xc8203edb80, 0x48, 0xc8203eda90, 0x4c, 0x0, 0xc820370fa0, 0x2, ...)
    <autogenerated>:3 +0x18e
main.(*builder).build(0xc8201769a0, 0xc8203f88f0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1484 +0x224c
main.(*builder).do.func1(0xc8203f88f0)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1257 +0x3b2
main.(*builder).do.func2(0xc82047f4d0, 0xc8201769a0, 0xc82048fd00)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1314 +0x156
created by main.(*builder).do
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1320 +0x39e

goroutine 11 [syscall]:
syscall.Syscall6(0x7, 0x12472, 0xc8204c6dcc, 0x0, 0xc820080bd0, 0x0, 0x0, 0xc8204c6da8, 0xdef30, 0xc8204c6da0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/asm_darwin_amd64.s:41 +0x5
syscall.wait4(0x12472, 0xc8204c6dcc, 0x0, 0xc820080bd0, 0x90, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/zsyscall_darwin_amd64.go:34 +0x7f
syscall.Wait4(0x12472, 0xc8204c6e14, 0x0, 0xc820080bd0, 0xc82012c7c0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/syscall_bsd.go:129 +0x55
os.(*Process).wait(0xc8200fd460, 0x2e, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec_unix.go:22 +0x105
os.(*Process).Wait(0xc8200fd460, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/doc.go:49 +0x2d
os/exec.(*Cmd).Wait(0xc82029b7c0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:396 +0x211
os/exec.(*Cmd).Run(0xc82029b7c0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:262 +0x64
main.(*builder).runOut(0xc8201769a0, 0xc8201b5080, 0x2f, 0xc82047e171, 0x8, 0x0, 0x0, 0x0, 0xc8201cc2c0, 0x20, ...)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:2049 +0x364
main.gcToolchain.gc(0xc8201769a0, 0xc8203dd000, 0xc8203ec280, 0x4d, 0xc82041de00, 0x51, 0x1, 0xc8200fd0a0, 0x2, 0x2, ...)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:2310 +0x1261
main.(*gcToolchain).gc(0x8acf60, 0xc8201769a0, 0xc8203dd000, 0xc8203ec280, 0x4d, 0xc82041de00, 0x51, 0x1, 0xc8200fd0a0, 0x2, ...)
    <autogenerated>:3 +0x18e
main.(*builder).build(0xc8201769a0, 0xc82027bad0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1484 +0x224c
main.(*builder).do.func1(0xc82027bad0)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1257 +0x3b2
main.(*builder).do.func2(0xc82047f4d0, 0xc8201769a0, 0xc82048fd00)
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1314 +0x156
created by main.(*builder).do
    /usr/local/Cellar/go/1.6.2/libexec/src/cmd/go/build.go:1320 +0x39e

goroutine 113 [syscall]:
syscall.Syscall(0x3, 0x4, 0xc820454800, 0x200, 0x0, 0x0, 0x9e679)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/asm_darwin_amd64.s:16 +0x5
syscall.read(0x4, 0xc820454800, 0x200, 0x200, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/zsyscall_darwin_amd64.go:972 +0x5f
syscall.Read(0x4, 0xc820454800, 0x200, 0x200, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/syscall_unix.go:161 +0x4d
os.(*File).read(0xc82012c6f8, 0xc820454800, 0x200, 0x200, 0xc820454800, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/file_unix.go:228 +0x75
os.(*File).Read(0xc82012c6f8, 0xc820454800, 0x200, 0x200, 0x1, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/file.go:95 +0x8a
bytes.(*Buffer).ReadFrom(0xc8202a8a10, 0x9c0b10, 0xc82012c6f8, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/bytes/buffer.go:176 +0x23f
io.copyBuffer(0x9cf4c8, 0xc8202a8a10, 0x9c0b10, 0xc82012c6f8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/io/io.go:374 +0x180
io.Copy(0x9cf4c8, 0xc8202a8a10, 0x9c0b10, 0xc82012c6f8, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/io/io.go:350 +0x64
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:236 +0x8b
os/exec.(*Cmd).Start.func1(0xc82029b180, 0xc8200fc1a0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:344 +0x1d
created by os/exec.(*Cmd).Start
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:345 +0x967

goroutine 126 [syscall]:
syscall.Syscall(0x3, 0x8, 0xc8202bb600, 0x200, 0x0, 0x0, 0x9e679)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/asm_darwin_amd64.s:16 +0x5
syscall.read(0x8, 0xc8202bb600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/zsyscall_darwin_amd64.go:972 +0x5f
syscall.Read(0x8, 0xc8202bb600, 0x200, 0x200, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/syscall_unix.go:161 +0x4d
os.(*File).read(0xc8204fe528, 0xc8202bb600, 0x200, 0x200, 0xc8202bb600, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/file_unix.go:228 +0x75
os.(*File).Read(0xc8204fe528, 0xc8202bb600, 0x200, 0x200, 0x1, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/file.go:95 +0x8a
bytes.(*Buffer).ReadFrom(0xc82023e7e0, 0x9c0b10, 0xc8204fe528, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/bytes/buffer.go:176 +0x23f
io.copyBuffer(0x9cf4c8, 0xc82023e7e0, 0x9c0b10, 0xc8204fe528, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/io/io.go:374 +0x180
io.Copy(0x9cf4c8, 0xc82023e7e0, 0x9c0b10, 0xc8204fe528, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/io/io.go:350 +0x64
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:236 +0x8b
os/exec.(*Cmd).Start.func1(0xc820427680, 0xc820348f20)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:344 +0x1d
created by os/exec.(*Cmd).Start
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:345 +0x967

goroutine 149 [syscall]:
syscall.Syscall(0x3, 0x5, 0xc820455000, 0x200, 0x0, 0x0, 0x9e679)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/asm_darwin_amd64.s:16 +0x5
syscall.read(0x5, 0xc820455000, 0x200, 0x200, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/zsyscall_darwin_amd64.go:972 +0x5f
syscall.Read(0x5, 0xc820455000, 0x200, 0x200, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/syscall/syscall_unix.go:161 +0x4d
os.(*File).read(0xc82012c7b8, 0xc820455000, 0x200, 0x200, 0xc820455000, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/file_unix.go:228 +0x75
os.(*File).Read(0xc82012c7b8, 0xc820455000, 0x200, 0x200, 0x1, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/file.go:95 +0x8a
bytes.(*Buffer).ReadFrom(0xc8202a8ee0, 0x9c0b10, 0xc82012c7b8, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/bytes/buffer.go:176 +0x23f
io.copyBuffer(0x9cf4c8, 0xc8202a8ee0, 0x9c0b10, 0xc82012c7b8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/io/io.go:374 +0x180
io.Copy(0x9cf4c8, 0xc8202a8ee0, 0x9c0b10, 0xc82012c7b8, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/io/io.go:350 +0x64
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:236 +0x8b
os/exec.(*Cmd).Start.func1(0xc82029b7c0, 0xc8200fd240)
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:344 +0x1d
created by os/exec.(*Cmd).Start
    /usr/local/Cellar/go/1.6.2/libexec/src/os/exec/exec.go:345 +0x967

goroutine 162 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/asm_amd64.s:1998 +0x1
go build github.com/Azure/custom-script-extension-linux/vendor/github.com/Azure/azure-docker-extension/pkg/vmextension/status: /usr/local/Cellar/go/1.6.2/libexec/pkg/tool/darwin_amd64/compile: exit status

@mikioh mikioh changed the title go build panicked with "non-Go code disabled sigaltstack" runtime: go build panicked with "non-Go code disabled sigaltstack" Jul 22, 2016

@mikioh

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2016

@ianlancetaylor ianlancetaylor self-assigned this Jul 22, 2016

@ianlancetaylor ianlancetaylor added this to the Go1.8 milestone Jul 22, 2016

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2016

The signal is SIGWINCH which is normally sent when the window size changes. Where you adjusting the size of your terminal window when it happened?

@ahmetb

This comment has been minimized.

Copy link
Author

commented Jul 22, 2016

@ianlancetaylor yes, I was running iTerm2 and just hit Cmd+D which would split my terminal emulator window horizontally into two. This effectively shrinks my current terminal window where the go build was running.

@carolynvs

This comment has been minimized.

Copy link

commented Sep 1, 2016

I just ran into this too, with go go1.6.2 darwin/amd64 by maximizing the iterm2 window during go build. I'm able to consistently repro this behavior.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2016

It's hard to imagine what the non-Go code is that changed the signal handlers. The obvious answer is the C resolver that the go command is linked against for 'go get'. But this was a 'go build' command, so it shouldn't have been doing any network work at all. Even so the code was there. I tried running a go build github.com/Azure/custom-script-extension-linux/... and send it a SIGWINCH while running and could not reproduce this, neither at tip or at go1.6.

It could be that if there is some C-created thread without a sigaltstack and it takes the signal but runs Go's signal handler. That would crash this way. But I don't see where that C-created thread is coming from in cmd/go.

@ahmetalpbalkan, what version of OS X are you using? Any fancy network firewall or other software?

@ahmetb

This comment has been minimized.

Copy link
Author

commented Oct 27, 2016

@rsc this was a pretty standard OS X 10.11 El Capitan setup with go1.6.2 installed via Homebrew. I am now trying to reproduce this on macOS 10.12 Sierra with go1.7.1. It no longer reproduces. It used to repro very easily by splitting iTerm2 windows while go build was running.

I don't think this issue is important enough to investigate deeper. Closing. Thanks for taking a look.

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