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: lock ordering problem between trace and wbufSpans #56554

Open
bcmills opened this issue Nov 3, 2022 · 1 comment
Open

runtime: lock ordering problem between trace and wbufSpans #56554

bcmills opened this issue Nov 3, 2022 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented Nov 3, 2022

#!watchflakes
post <- `fatal error: lock ordering problem` && `0 : trace` && `1 : wbufSpans`

https://build.golang.org/log/af083d40156b011db2e0cadd6040692cf579967c:

99928  ======
0 : trace 42 0x657b20
1 : wbufSpans 39 0x651030
fatal error: lock ordering problem

runtime stack:
runtime.throw({0x553dbd?, 0x0?})
	/workdir/go/src/runtime/panic.go:1047 +0x5d fp=0x7f153fffeb58 sp=0x7f153fffeb28 pc=0x4392fd
runtime.checkRanks(0xc0001021a0, 0xc000067000?, 0x4cb503?)
	/workdir/go/src/runtime/lockrank_on.go:156 +0x22d fp=0x7f153fffebb8 sp=0x7f153fffeb58 pc=0x40de8d
runtime.lockWithRankMayAcquire.func1()
	/workdir/go/src/runtime/lockrank_on.go:229 +0x89 fp=0x7f153fffebe8 sp=0x7f153fffebb8 pc=0x40e5c9
runtime.lockWithRankMayAcquire(0x40e0cc?, 0xc0001021a0?)
	/workdir/go/src/runtime/lockrank_on.go:218 +0x65 fp=0x7f153fffec20 sp=0x7f153fffebe8 pc=0x40e505
runtime.getempty()
	/workdir/go/src/runtime/mgcwork.go:362 +0x3f fp=0x7f153fffec80 sp=0x7f153fffec20 pc=0x42881f
runtime.(*gcWork).init(0xc000030638)
	/workdir/go/src/runtime/mgcwork.go:101 +0x1c fp=0x7f153fffec90 sp=0x7f153fffec80 pc=0x4280dc
runtime.(*gcWork).putBatch(0xc000030638, {0xc000030670, 0x1, 0x200})
	/workdir/go/src/runtime/mgcwork.go:175 +0x46 fp=0x7f153fffece8 sp=0x7f153fffec90 pc=0x4282c6
runtime.wbBufFlush1(0xc00002f400)
	/workdir/go/src/runtime/mwbbuf.go:287 +0x24f fp=0x7f153fffed30 sp=0x7f153fffece8 pc=0x4348ef
runtime.wbBufFlush.func1()
	/workdir/go/src/runtime/mwbbuf.go:201 +0x25 fp=0x7f153fffed48 sp=0x7f153fffed30 pc=0x4671c5
runtime.wbBufFlush(0x40e280?, 0xc0001021a0?)
	/workdir/go/src/runtime/mwbbuf.go:200 +0x6c fp=0x7f153fffed68 sp=0x7f153fffed48 pc=0x43464c
runtime.wbBufFlush(0x657b38, 0x0)
	<autogenerated>:1 +0x2a fp=0x7f153fffed88 sp=0x7f153fffed68 pc=0x47052a
runtime.gcWriteBarrier()
	/workdir/go/src/runtime/asm_amd64.s:1692 +0xa3 fp=0x7f153fffee08 sp=0x7f153fffed88 pc=0x46dfc3
runtime.gcWriteBarrierDX()
	/workdir/go/src/runtime/asm_amd64.s:1720 +0x7 fp=0x7f153fffee10 sp=0x7f153fffee08 pc=0x46e047
runtime.readTrace0()
	/workdir/go/src/runtime/trace.go:535 +0x49a fp=0x7f153fffee50 sp=0x7f153fffee10 pc=0x45c59a
runtime.ReadTrace.func1()
	/workdir/go/src/runtime/trace.go:439 +0x2a fp=0x7f153fffee70 sp=0x7f153fffee50 pc=0x45c0aa
runtime.systemstack()
	/workdir/go/src/runtime/asm_amd64.s:492 +0x49 fp=0x7f153fffee78 sp=0x7f153fffee70 pc=0x46bd29

goroutine 188 [running]:
runtime.systemstack_switch()
	/workdir/go/src/runtime/asm_amd64.s:459 fp=0xc0001f2738 sp=0xc0001f2730 pc=0x46bcc0
runtime.ReadTrace()
	/workdir/go/src/runtime/trace.go:438 +0x88 fp=0xc0001f27a0 sp=0xc0001f2738 pc=0x45c028
runtime/trace.Start.func1()
	/workdir/go/src/runtime/trace/trace.go:130 +0x47 fp=0xc0001f27e0 sp=0xc0001f27a0 pc=0x4beb67
runtime.goexit()
	/workdir/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0001f27e8 sp=0xc0001f27e0 pc=0x46dee1
created by runtime/trace.Start
	/workdir/go/src/runtime/trace/trace.go:128 +0xef

(attn @golang/runtime)

@bcmills bcmills added this to the Go1.20 milestone Nov 3, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 3, 2022
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 3, 2022
@mknyszek mknyszek self-assigned this Nov 9, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Nov 23, 2022

I still plan to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Todo
Status: No status
Development

No branches or pull requests

3 participants