From da814c51ff42f56fb28582f088f4d72b500061fe Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 16 Jul 2020 23:53:52 +0800 Subject: [PATCH] runtime: dump the status of lockedg on error When lockedg's status is bad, it will be helpful to dump the bad status. Besides, dumpgstatus() will dump current g anyway, it's more helpful to dump lockedg as well than dumping current g twice. --- src/runtime/proc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 2399f0a1d3..83c04e2edb 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2039,8 +2039,8 @@ func stoplockedm() { noteclear(&_g_.m.park) 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())