From: Tiwei Bie Date: Thu, 15 Oct 2020 01:43:51 +0000 (+0000) Subject: runtime: dump the status of lockedg on error X-Git-Tag: go1.16beta1~552 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bc0b198bd75a8eef45d0965531ba6fa127d0e8ec;p=gostls13.git runtime: dump the status of lockedg on error The dumpgstatus() will dump current g's status anyway. When lockedg's status is bad, it's more helpful to dump lockedg's status as well than dumping current g's status twice. Change-Id: If5248cb94b9cdcbf4ceea07562237e1d6ee28489 GitHub-Last-Rev: da814c51ff42f56fb28582f088f4d72b500061fe GitHub-Pull-Request: golang/go#40248 Reviewed-on: https://go-review.googlesource.com/c/go/+/243097 Reviewed-by: Keith Randall Trust: Emmanuel Odeke Run-TryBot: Emmanuel Odeke TryBot-Result: Go Bot --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index aeacb23391..83d2a524e0 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2302,8 +2302,8 @@ func stoplockedm() { mPark() status := readgstatus(_g_.m.lockedg.ptr()) if status&^_Gscan != _Grunnable { - print("runtime:stoplockedm: g is not Grunnable or Gscanrunnable\n") - dumpgstatus(_g_) + print("runtime:stoplockedm: lockedg (atomicstatus=", status, ") is not Grunnable or Gscanrunnable\n") + dumpgstatus(_g_.m.lockedg.ptr()) throw("stoplockedm: not runnable") } acquirep(_g_.m.nextp.ptr())