aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-11-14 21:34:35 -0500
committerCherry Zhang <cherryyz@google.com>2019-11-27 01:30:32 +0000
commit0f251028585e052a3d34dcce83b05d8aa9ba170e (patch)
treeac9f64fd93fb23a8e00c97298056214e4f2021d8 /src/runtime/stack.go
parentb2482e481722357c6daa98ef074d8eaf8ac4baf3 (diff)
downloadgo-0f251028585e052a3d34dcce83b05d8aa9ba170e.tar.xz
runtime: print more information on stack overflow
Print the current SP and (old) stack bounds when the stack grows too large. This helps to identify the problem: whether a large stack is used, or something else goes wrong. For #35470. Change-Id: I34a4064d5c7280978391d835e171b90d06f87222 Reviewed-on: https://go-review.googlesource.com/c/go/+/207351 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/runtime/stack.go')
-rw-r--r--src/runtime/stack.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index 84fbd33329..ebbe3e013d 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -1030,6 +1030,7 @@ func newstack() {
newsize := oldsize * 2
if newsize > maxstacksize {
print("runtime: goroutine stack exceeds ", maxstacksize, "-byte limit\n")
+ print("runtime: sp=", hex(sp), " stack=[", hex(gp.stack.lo), ", ", hex(gp.stack.hi), "]\n")
throw("stack overflow")
}