Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
runtime: signal arriving during needm/dropm invokes Go signal handler in bad state #12277
Comments
ianlancetaylor
added this to the Go1.5.1 milestone
Aug 25, 2015
|
CC @randall77 |
|
Should runtime.sighandler be labeled nosplit?
Please give https://golang.org/cl/13910/ a try.
|
|
Maybe, but then would all code called from sigtramp need to be marked nosplit? Just hunting for an example, tracebacktrap is not marked nosplit as well. |
|
sighandler runs on the signal stack with g = the signal goroutine. If the handler is running off the signal stack, there is a bug. We should not mark things nosplit; that will just hide the bug. |
|
Can you reproduce this? If this is in a go-fuzz-built binary, not go-fuzz itself, I wonder if go-fuzz is trying to instrument package runtime and broke the signal handlers somehow. The decimal g= below really is 0xc820ad8000 aka m->gsignal, so that part is right. But obviously the stack bounds are not. That means that somehow the code is either on the wrong stack or overflowed the signal stack. The latter could happen if the signal handler somehow caused a new signal to arrive and be handled. I thought we had signals masked off such that that isn't allowed and would just be a plain OS-level process crash, but maybe some signals can leak through. If it happened recursively repeatedly, you'd blow out the signal stack. |
|
go-fuzz does not instument the following list of packages:
|
|
I think go-fuzz was slow to terminate, and I sent several SIGINTs (ctrl+C) in quick succession. I think I was go-fuzzing github.com/anacrolix/torrent/bencode on OSX, though there's nothing unusual about that package. I don't currently have time to try and reproduce, I can revisit this in a week if the issue hasn't progressed. |
|
I am getting this bug, without using go-fuzz.
To reproduce:
It seems to take a random amount of time for the bug to manifest (up to 10 seconds). |
AkihiroSuda
referenced this issue
Sep 4, 2015
Open
runtime: c-shared with LD_PRELOAD does not work for some programs #12465
ianlancetaylor
modified the milestones:
Go1.5.2,
Go1.5.1
Sep 8, 2015
|
@jnjackins, thanks for the goban example! |
gopherbot
commented
Nov 16, 2015
|
CL https://golang.org/cl/16915 mentions this issue. |
rsc
changed the title from
runtime: fatal error: wrong goroutine in newstack
to
runtime: signal arriving during needm/dropm invokes Go signal handler in bad state
Nov 17, 2015
rsc
closed this
in
f8e6418
Nov 18, 2015
gopherbot
commented
Nov 19, 2015
|
CL https://golang.org/cl/17072 mentions this issue. |
added a commit
that referenced
this issue
Nov 20, 2015
gopherbot
commented
Nov 20, 2015
|
CL https://golang.org/cl/17141 mentions this issue. |
gopherbot
commented
Nov 20, 2015
|
CL https://golang.org/cl/17129 mentions this issue. |
anacrolix commentedAug 23, 2015
While running go-fuzz, I sent it SIGINT, and this happened:
$ go version
go version go1.5 darwin/amd64