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: scan missed a g #17473
Comments
Faster (and more debuggable) way to reproduce: cd misc/cgo/test
go test -c -ldflags -linkmode=auto
while GOGC=10 GODEBUG=gccheckmark=1 GOTRACEBACK=2 ./test.test; do; done The panic happens almost immediately, but then the process wedges hard in the middle of printing the traceback (doesn't even respond to SIGINT). It's stuck on the Poking around in gdb, the missed G is indeed not on the rescan list and its g.gcRescan is -1. If I force it past the lock, I get the following traceback: gp 0xc420074d00 goid 84 status 3 gcscandone false gcscanvalid true fatal error: scan missed a g runtime stack: runtime.throw(0x5ae8b3, 0xf) /home/austin/go.dev/src/runtime/panic.go:587 +0x95 fp=0x7ff9c999ddd0 sp=0x7ff9c999ddb0 runtime.gcMarkRootCheck() /home/austin/go.dev/src/runtime/mgcmark.go:126 +0x20c fp=0x7ff9c999de20 sp=0x7ff9c999ddd0 runtime.gcMark(0xbd9385843f3e) /home/austin/go.dev/src/runtime/mgc.go:1599 +0x4e3 fp=0x7ff9c999de68 sp=0x7ff9c999de20 runtime.gcMarkTermination.func1() /home/austin/go.dev/src/runtime/mgc.go:1194 +0x2d fp=0x7ff9c999de80 sp=0x7ff9c999de68 runtime.systemstack(0xc420030000) /home/austin/go.dev/src/runtime/asm_amd64.s:298 +0x79 fp=0x7ff9c999de88 sp=0x7ff9c999de80 runtime.mstart() /home/austin/go.dev/src/runtime/proc.go:1081 fp=0x7ff9c999de90 sp=0x7ff9c999de88 goroutine 18 [garbage collection]: runtime.systemstack_switch() /home/austin/go.dev/src/runtime/asm_amd64.s:252 fp=0xc420036540 sp=0xc420036538 runtime.gcMarkTermination() /home/austin/go.dev/src/runtime/mgc.go:1202 +0x141 fp=0xc420036728 sp=0xc420036540 runtime.gcMarkDone() /home/austin/go.dev/src/runtime/mgc.go:1166 +0x1db fp=0xc420036748 sp=0xc420036728 runtime.gcBgMarkWorker(0xc420030000) /home/austin/go.dev/src/runtime/mgc.go:1513 +0x2c6 fp=0xc4200367b8 sp=0xc420036748 runtime.goexit() /home/austin/go.dev/src/runtime/asm_amd64.s:2158 +0x1 fp=0xc4200367c0 sp=0xc4200367b8 created by runtime.gcBgMarkStartWorkers /home/austin/go.dev/src/runtime/mgc.go:1357 +0x98 Based on the traceback of goroutine 84, this goroutine is a cgo spare that was created by |
CL https://golang.org/cl/31139 mentions this issue. |
What version of Go are you using (
go version
)?Current master (42f5ee4).
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Endless PASSes.
What did you see instead?
After ~20 iterations:
Note that the "scan missed a g" check is only done in gccheckmark mode, which means this bug could be manifesting as a dangling pointer in normal usage. Also, I found this while stress-testing all.bash and it only affected the misc/cgo tests.
/cc @RLH
The text was updated successfully, but these errors were encountered: