]> Cypherpunks repositories - gostls13.git/commit
runtime: print user stack on other threads during GOTRACBEACK=crash
authorAustin Clements <austin@google.com>
Fri, 10 Mar 2017 15:59:39 +0000 (10:59 -0500)
committerAustin Clements <austin@google.com>
Wed, 15 Mar 2017 22:16:12 +0000 (22:16 +0000)
commit4b8f41daa63154949104d27d70acc3857a0b4b0b
tree4487b89fbac4baf1e9b950d20bce72f80c650fb6
parentf2e87158f06902daa44d34b4846611f8520e4491
runtime: print user stack on other threads during GOTRACBEACK=crash

Currently, when printing tracebacks of other threads during
GOTRACEBACK=crash, if the thread is on the system stack we print only
the header for the user goroutine and fail to print its stack. This
happens because we passed the g0 to traceback instead of curg. The g0
never has anything set in its gobuf, so traceback doesn't print
anything.

Fix this by passing _g_.m.curg to traceback instead of the g0.

Fixes #19494.

Change-Id: Idfabf94d6a725e9cdf94a3923dead6455ef3b217
Reviewed-on: https://go-review.googlesource.com/38012
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/crash_unix_test.go
src/runtime/export_test.go
src/runtime/signal_sighandler.go