]> Cypherpunks repositories - gostls13.git/commit
runtime: fix a lock rank ordering and some edges.
authorDan Scales <danscales@google.com>
Thu, 4 Nov 2021 23:03:49 +0000 (16:03 -0700)
committerDan Scales <danscales@google.com>
Fri, 5 Nov 2021 17:17:30 +0000 (17:17 +0000)
commit62c6ff4296fa5919a208552c57b44e4710b4e5e1
tree480b291e8ecc3feaa79b1f679f48bfa213adf9b0
parent3796df1b13c6be62ca28244dcd6121544770e371
runtime: fix a lock rank ordering and some edges.

The first stack-trace in #49361 shows that traceBuf must precede fin in
lockrank ordering, since traceBuf is acquired in StartTrace(), which
eventually leads to getting fin in queueFinalizer(). It is fine to move
traceBuf above fin, since there are no other conflicting dependencies.

The second stack trace shows that there is an edge bewtween reflectOffs
and fin, since reflectOffs is acquired in addReflectOff, and map
operations can lead to an allocation that eventually causes fin to be
acquired in queueFinalizer().

Fixes #49361

Change-Id: I8e857ef9ecdff37fdd229e4dba22e15bc71d4ba5
Reviewed-on: https://go-review.googlesource.com/c/go/+/361407
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/lockrank.go