runtime: fix outdated g.m comment in traceback.go

Change-Id: Idfd02781a9ee550da240ef53898943e8cd37dd64
Reviewed-on: https://go-review.googlesource.com/c/go/+/418574
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Michael Pratt 2022-07-20 13:20:48 -04:00
parent d723df76da
commit 9dbc0f3556

View file

@ -1051,10 +1051,10 @@ func tracebackothers(me *g) {
} }
print("\n") print("\n")
goroutineheader(gp) goroutineheader(gp)
// Note: gp.m == g.m occurs when tracebackothers is // Note: gp.m == getg().m occurs when tracebackothers is called
// called from a signal handler initiated during a // from a signal handler initiated during a systemstack call.
// systemstack call. The original G is still in the // The original G is still in the running state, and we want to
// running state, and we want to print its stack. // print its stack.
if gp.m != getg().m && readgstatus(gp)&^_Gscan == _Grunning { if gp.m != getg().m && readgstatus(gp)&^_Gscan == _Grunning {
print("\tgoroutine running on other thread; stack unavailable\n") print("\tgoroutine running on other thread; stack unavailable\n")
printcreatedby(gp) printcreatedby(gp)