Skip to content

runtime: GC with gctrace=2 fails #9942

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

Closed
rsc opened this issue Feb 20, 2015 · 3 comments
Closed

runtime: GC with gctrace=2 fails #9942

rsc opened this issue Feb 20, 2015 · 3 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Feb 20, 2015

This crashes, and seems to have been crashing for a while:

go test -c strings && GODEBUG=gctrace=2,gccheckmark=0 ./strings.test

My cleanup means that now in gccheckmark=1 mode it will also crash, but that's not really my fault. (My cleanup fixed the bug that in gccheckmark=1 mode the gctrace=2 was not doing a full mark sweep in the second GC.)

@aclements @RLH

@rsc rsc added this to the Go1.5 milestone Feb 20, 2015
@rsc
Copy link
Contributor Author

rsc commented Feb 20, 2015

g% go test -c strings && GODEBUG=gctrace=2,gccheckmark=0 ./strings.test
gc1(1): 0+1+103+0 us, 2 -> 4 MB, 310 (310-0) objects, 5 goroutines, 39/0/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc2(1): 152+1+331+0 us, 2 -> 2 MB, 235 (311-76) objects, 6 goroutines, 39/0/31 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc3(1): 1+1+129+0 us, 2 -> 4 MB, 31207 (31294-87) objects, 5 goroutines, 399/1/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc4(1): 995+2+336+1 us, 2 -> 2 MB, 233 (31294-31061) objects, 5 goroutines, 399/0/392 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc5(1): 2+2+210+1 us, 2 -> 6 MB, 3350 (34420-31070) objects, 6 goroutines, 399/0/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc6(1): 145+1+287+0 us, 6 -> 6 MB, 247 (34420-34173) objects, 6 goroutines, 399/0/62 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc7(1): 1+1+95+0 us, 2 -> 10 MB, 237 (34422-34185) objects, 6 goroutines, 399/1/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc8(1): 54+1+305+0 us, 10 -> 10 MB, 237 (34422-34185) objects, 6 goroutines, 399/0/29 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc9(1): 1+2+190+1 us, 2 -> 14 MB, 237 (34424-34187) objects, 6 goroutines, 399/6/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
gc10(1): 56+1+340+0 us, 14 -> 14 MB, 237 (34424-34187) objects, 6 goroutines, 399/0/29 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
fatal error: runtime: sudog with non-nil elem

goroutine 1 [running]:
runtime.throw(0x1eeff0, 0x20)
    /Users/rsc/g/go/src/runtime/panic.go:511 +0xa0 fp=0x208423bd0 sp=0x208423bb8
runtime.releaseSudog(0x2083525c0)
    /Users/rsc/g/go/src/runtime/proc.go:201 +0x32 fp=0x208423bf0 sp=0x208423bd0
runtime.chanrecv(0x13c8c0, 0x20842a2a0, 0x208423dc8, 0x208349c01, 0x60000)
    /Users/rsc/g/go/src/runtime/chan.go:429 +0x4a6 fp=0x208423c78 sp=0x208423bf0
runtime.chanrecv1(0x13c8c0, 0x20842a2a0, 0x208423dc8)
    /Users/rsc/g/go/src/runtime/chan.go:318 +0x2b fp=0x208423ca8 sp=0x208423c78
testing.RunTests(0x213050, 0x2aca00, 0x2e, 0x2e, 0x1)
    /Users/rsc/g/go/src/testing/testing.go:557 +0xa8c fp=0x208423e50 sp=0x208423ca8
testing.(*M).Run(0x2083765a0, 0x2ace60)
    /Users/rsc/g/go/src/testing/testing.go:486 +0x79 fp=0x208423ed8 sp=0x208423e50
main.main()
    strings/_test/_testmain.go:278 +0x1d5 fp=0x208423fa0 sp=0x208423ed8
runtime.main()
    /Users/rsc/g/go/src/runtime/proc.go:88 +0x1d2 fp=0x208423fe0 sp=0x208423fa0
runtime.goexit()
    /Users/rsc/g/go/src/runtime/asm_amd64.s:2446 +0x1 fp=0x208423fe8 sp=0x208423fe0
g% 

@dvyukov
Copy link
Member

dvyukov commented Feb 20, 2015

This seems like an issue with GC (heap corruption) rather than with sudoges. At least I don't see how sg.elem can be non nil in chan code.

@aclements
Copy link
Member

Fixed by e31e35a

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants