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 #52794

Closed
bcmills opened this issue May 9, 2022 · 3 comments
Closed

runtime: “lock ordering problem” between trace and wbufSpans #52794

bcmills opened this issue May 9, 2022 · 3 comments
Labels
NeedsFix release-blocker
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented May 9, 2022

2022-05-08T17:28:26-1b86ef4/linux-amd64-staticlockranking:

37363  ======
0 : trace 28 0x8485a0
1 : wbufSpans 39 0x840770
fatal error: lock ordering problem

(attn @golang/runtime; see previously #41021)

@bcmills bcmills added NeedsInvestigation release-blocker labels May 9, 2022
@bcmills bcmills added this to the Go1.19 milestone May 9, 2022
@rhysh
Copy link
Contributor

@rhysh rhysh commented May 9, 2022

If I understand the log correctly, this would mean that lockrank.go would not allow write barriers when an M is holding trace.lock. The call to gcWriteBarrierCX comes from https://github.com/golang/go/blob/1b86ef47de/src/runtime/trace.go#L410, setting trace.strings = nil. But that line also exists in go1.18.1, still within the section that holds trace.lock https://github.com/golang/go/blob/go1.18.1/src/runtime/trace.go#L368.

Another "missing, but valid, edge on the wbufSpans lock"?

I don't see lockRankTrace in the list for lockRankMHeap https://github.com/golang/go/blob/1b86ef47de/src/runtime/lockrank.go#L244 , but I also don't see anywhere in runtime.StopTrace that allocates .. only write barriers.

@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented May 10, 2022

@rhysh Yeah, this just looks like a missing edge to me. The write barrier path can acquire the mheap lock in order to allocate a new write barrier buffer.

@bcmills bcmills added the NeedsFix label May 10, 2022
@gopherbot gopherbot removed the NeedsInvestigation label May 10, 2022
@mknyszek mknyszek self-assigned this May 10, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented May 10, 2022

Change https://go.dev/cl/405476 mentions this issue: runtime: add lock partial order edge for trace and wbufSpans and mheap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants