From d75fbac54d34484041a5ecb0b65f298b821cd963 Mon Sep 17 00:00:00 2001 From: Dan Scales Date: Sat, 1 May 2021 13:57:00 -0700 Subject: [PATCH] cmd/compile: add edge from lock rank edge from forceGC to traceStackTab This edge can happen when forcegchelper() calls goparkunlock(&forcegc.lock, ...) while holding the forcegc lock. goparkunlock() eventually calls park_m(). In park_m(), traceGoPark() (which leads to (*traceStackTable).put() and acquires the traceStackTab lock) can be called before the forcegc lock is released. Fixes #45774 Change-Id: If0fceab596712eb9ec0b9b47326778bc0ff80913 Reviewed-on: https://go-review.googlesource.com/c/go/+/316029 Run-TryBot: Dan Scales TryBot-Result: Go Bot Reviewed-by: Michael Knyszek Trust: Carlos Amedee --- src/runtime/lockrank.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/lockrank.go b/src/runtime/lockrank.go index b600c2132b6..dde9f7c21a7 100644 --- a/src/runtime/lockrank.go +++ b/src/runtime/lockrank.go @@ -217,7 +217,7 @@ var lockPartialOrder [][]lockRank = [][]lockRank{ lockRankGcBitsArenas: {lockRankSysmon, lockRankScavenge, lockRankAssistQueue, lockRankCpuprof, lockRankSched, lockRankAllg, lockRankTimers, lockRankItab, lockRankReflectOffs, lockRankHchan, lockRankNotifyList, lockRankTraceBuf, lockRankTraceStrings}, lockRankRoot: {}, lockRankTrace: {lockRankSysmon, lockRankScavenge, lockRankForcegc, lockRankAssistQueue, lockRankSweep, lockRankSched, lockRankHchan, lockRankTraceBuf, lockRankTraceStrings, lockRankRoot}, - lockRankTraceStackTab: {lockRankScavenge, lockRankSweepWaiters, lockRankAssistQueue, lockRankSweep, lockRankSched, lockRankAllg, lockRankTimers, lockRankHchan, lockRankFin, lockRankNotifyList, lockRankTraceBuf, lockRankTraceStrings, lockRankRoot, lockRankTrace}, + lockRankTraceStackTab: {lockRankScavenge, lockRankForcegc, lockRankSweepWaiters, lockRankAssistQueue, lockRankSweep, lockRankSched, lockRankAllg, lockRankTimers, lockRankHchan, lockRankFin, lockRankNotifyList, lockRankTraceBuf, lockRankTraceStrings, lockRankRoot, lockRankTrace}, lockRankNetpollInit: {lockRankTimers}, lockRankRwmutexW: {},