Closed
Description
What version of Go are you using (go version
)?
tip (f71f3d1)
Does this issue reproduce with the latest release?
Yes, reproducible with Go 1.18.
Go 1.17 seems to work fine with no failure.
What operating system and processor architecture are you using (go env
)?
darwin/amd64
What did you do?
Running Go program with GODEBUG=gcstoptheworld=2
.
What did you expect to see?
Runs successfully.
What did you see instead?
Crash in GC.
$ GODEBUG=gcstoptheworld=2 go tool compile hello.go
fatal error: failed to set sweep barrier
goroutine 35 [running]:
runtime.throw({0x1949578?, 0xf738ad50e6127?})
/Users/cherryyz/src/go/src/runtime/panic.go:1047 +0x5d fp=0xc0004d7538 sp=0xc0004d7508 pc=0x10369bd
runtime.gcMarkTermination()
/Users/cherryyz/src/go/src/runtime/mgc.go:1056 +0xc6d fp=0xc0004d76f0 sp=0xc0004d7538 pc=0x101b3ad
runtime.gcMarkDone()
/Users/cherryyz/src/go/src/runtime/mgc.go:918 +0x2ac fp=0xc0004d7750 sp=0xc0004d76f0 pc=0x101a4ac
runtime.gcBgMarkWorker()
/Users/cherryyz/src/go/src/runtime/mgc.go:1367 +0x345 fp=0xc0004d77e0 sp=0xc0004d7750 pc=0x101b865
runtime.goexit()
/Users/cherryyz/src/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0004d77e8 sp=0xc0004d77e0 pc=0x1069a81
created by runtime.gcBgMarkStartWorkers
/Users/cherryyz/src/go/src/runtime/mgc.go:1159 +0x25
goroutine 1 [runnable]:
runtime.Gosched(...)
/Users/cherryyz/src/go/src/runtime/proc.go:318
runtime.gcStart({0x212a108?, 0x1fcbc1b?, 0x10dc20?})
/Users/cherryyz/src/go/src/runtime/mgc.go:749 +0x49c fp=0xc000422c90 sp=0xc000422c08 pc=0x1019dbc
runtime.mallocgc(0xb0, 0x18d7240, 0x1)
/Users/cherryyz/src/go/src/runtime/malloc.go:1138 +0x80f fp=0xc000422d08 sp=0xc000422c90 pc=0x100d40f
runtime.makeslice(0x19242a0?, 0xc00010dc20?, 0x21334d0?)
/Users/cherryyz/src/go/src/runtime/slice.go:103 +0x52 fp=0xc000422d30 sp=0xc000422d08 pc=0x104df72
cmd/compile/internal/ssa.(*regAllocState).regalloc(0xc00015a480, 0xc000412380)
/Users/cherryyz/src/go/src/cmd/compile/internal/ssa/regalloc.go:1176 +0x90d fp=0xc0004238f0 sp=0xc000422d30 pc=0x137b4ed
cmd/compile/internal/ssa.regalloc(0xc000412380?)
/Users/cherryyz/src/go/src/cmd/compile/internal/ssa/regalloc.go:148 +0x45 fp=0xc000423920 sp=0xc0004238f0 pc=0x13770e5
cmd/compile/internal/ssa.Compile(0xc000412380)
/Users/cherryyz/src/go/src/cmd/compile/internal/ssa/compile.go:98 +0x9be fp=0xc000427598 sp=0xc000423920 pc=0x131333e
cmd/compile/internal/ssagen.buildssa(0xc000404140, 0x0)
/Users/cherryyz/src/go/src/cmd/compile/internal/ssagen/ssa.go:574 +0x2007 fp=0xc000427910 sp=0xc000427598 pc=0x1680b27
cmd/compile/internal/ssagen.Compile(0xc000404140, 0xc0003d9f80?)
/Users/cherryyz/src/go/src/cmd/compile/internal/ssagen/pgen.go:183 +0x4c fp=0xc0004279d8 sp=0xc000427910 pc=0x1677c8c
cmd/compile/internal/gc.compileFunctions.func4.1(0x1?)
/Users/cherryyz/src/go/src/cmd/compile/internal/gc/compile.go:153 +0x3a fp=0xc000427a18 sp=0xc0004279d8 pc=0x1849e3a
cmd/compile/internal/gc.compileFunctions.func2(0x0?)
/Users/cherryyz/src/go/src/cmd/compile/internal/gc/compile.go:125 +0x1e fp=0xc000427a30 sp=0xc000427a18 pc=0x1849a7e
cmd/compile/internal/gc.compileFunctions.func4({0xc000014520, 0x1, 0x1?})
/Users/cherryyz/src/go/src/cmd/compile/internal/gc/compile.go:152 +0x53 fp=0xc000427a78 sp=0xc000427a30 pc=0x1849d33
cmd/compile/internal/gc.compileFunctions()
/Users/cherryyz/src/go/src/cmd/compile/internal/gc/compile.go:163 +0x162 fp=0xc000427ad8 sp=0xc000427a78 pc=0x1849c02
cmd/compile/internal/gc.Main(0x1967670)
/Users/cherryyz/src/go/src/cmd/compile/internal/gc/main.go:306 +0x1154 fp=0xc000427f20 sp=0xc000427ad8 pc=0x184b774
main.main()
/Users/cherryyz/src/go/src/cmd/compile/main.go:57 +0xdd fp=0xc000427f80 sp=0xc000427f20 pc=0x187351d
runtime.main()
/Users/cherryyz/src/go/src/runtime/proc.go:250 +0x212 fp=0xc000427fe0 sp=0xc000427f80 pc=0x10391d2
runtime.goexit()
/Users/cherryyz/src/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000427fe8 sp=0xc000427fe0 pc=0x1069a81
... other goroutine stacks omitted ...
cc @mknyszek @golang/runtime