Skip to content

Commit

Permalink
runtime: print runtime frames in throwsplit trace
Browse files Browse the repository at this point in the history
newstack manually prints the stack trace if we try to grow the stack
when throwsplit is set. However, the default behavior is to omit
runtime frames. Since runtime frames can be critical to understanding
this crash, this change fixes this traceback to include them.

Updates #21431.

Change-Id: I5aa43f43aa2f10a8de7d67bcec743427be3a3b5d
Reviewed-on: https://go-review.googlesource.com/79518
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
aclements committed Nov 22, 2017
1 parent 09739d2 commit 4671da0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ func newstack() {
"\tmorebuf={pc:", hex(morebuf.pc), " sp:", hex(morebuf.sp), " lr:", hex(morebuf.lr), "}\n",
"\tsched={pc:", hex(gp.sched.pc), " sp:", hex(gp.sched.sp), " lr:", hex(gp.sched.lr), " ctxt:", gp.sched.ctxt, "}\n")

thisg.m.traceback = 2 // Include runtime frames
traceback(morebuf.pc, morebuf.sp, morebuf.lr, gp)
throw("runtime: stack split at bad time")
}
Expand Down

0 comments on commit 4671da0

Please sign in to comment.