]> Cypherpunks repositories - gostls13.git/commit
runtime: fix another lock ordering problem
authorRuss Cox <rsc@golang.org>
Wed, 13 Mar 2024 02:00:22 +0000 (22:00 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 13 Mar 2024 17:00:15 +0000 (17:00 +0000)
commitb2e9221089f37400f309637b205f21af7dcb063b
tree208b079bd15ded04c578103f4746fe4fb4f453ef
parent6e5398bad16aba15db365b72cb70d1177330b603
runtime: fix another lock ordering problem

https://logs.chromium.org/logs/golang/buildbucket/cr-buildbucket/8753622336585847105/+/u/step/11/log/2
shows a staticlockranking crash with pollcache (defaulted to LEAF)
being held during a write barrier, which got unlucky and acquired
wbufSpans, triggering a lock ordering throw.

My change in https://go-review.googlesource.com/c/go/+/570335/13/src/runtime/netpoll.go
around line 700 caused batching of many write barriers on the first
call rather than having just a few write barriers on each call,
making the crash much more likely, but the ordering problem
appears to have always existed. We just never allocated enough
pollDescs to trigger it.

Change-Id: Icb5e8340a5027dd4f7535a5ef02b2868476539e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/571195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/lockrank.go
src/runtime/mklockrank.go
src/runtime/netpoll.go