Join GitHub today
runtime: fatal error: checkdead: runnable g [1.13 backport] #40503
In a Go release meeting, we noticed issue #40368 likely affects Go 1.13 as well. This needs to be confirmed, and if so, this is the tracking issue for #40368 to be considered for backport to the next 1.13 minor release.
Including a copy of the rationale to backport from the 1.14 tracking issue #40398:
So I've been unable to reproduce this on 1.13, though I believe it is still affected.
In general, the racing startm call must come from sysmon, as most other calls come from M's considered "running" by checkdead and would thus not trigger the throw. In 1.14+, sysmon is partially responsible for handling timers, so the timer expiration startm is an easy place for this race to occur.
In 1.13, sysmon was not responsible for timers, thus that startm doesn't exist, but there are two others: one for netpoll, and one for forcegc. Ironically, the netpoll case already handles this exact problem from #6070, which I hadn't noticed before now. I may be able to clean those up in 1.16 that we have another approach to this.
The forcegc should be subject to this problem, but it only runs every 2 minutes, so it is extremely rare. I'll still send the backport patch for consideration for this case, though I'm not sure how important it is.