diff options
author | Austin Clements <austin@google.com> | 2016-10-13 10:44:57 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-10-17 18:56:09 +0000 |
commit | 687d9d5d78f8a2d09b2052e73be0c83740e17fda (patch) | |
tree | d8aa74b0a3aea918b939be3aad6fda4c5d4e0946 /src/runtime/asm_mips64x.s | |
parent | 0ba3c607dfcc90072191375d57c4059be1ae96c7 (diff) | |
download | go-687d9d5d78f8a2d09b2052e73be0c83740e17fda.tar.gz go-687d9d5d78f8a2d09b2052e73be0c83740e17fda.zip |
runtime: print a message on bad morestack
If morestack runs on the g0 or gsignal stack, it currently performs
some abort operation that typically produces a signal (e.g., it does
an INT $3 on x86). This is useful if you're running in a debugger, but
if you're not, the runtime tries to trap this signal, which is likely
to send the program into a deeper spiral of collapse and lead to very
confusing diagnostic output.
Help out people trying to debug without a debugger by making morestack
print an informative message before blowing up.
Change-Id: I2814c64509b137bfe20a00091d8551d18c2c4749
Reviewed-on: https://go-review.googlesource.com/31133
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/asm_mips64x.s')
-rw-r--r-- | src/runtime/asm_mips64x.s | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/asm_mips64x.s b/src/runtime/asm_mips64x.s index 138181833c..e29522367d 100644 --- a/src/runtime/asm_mips64x.s +++ b/src/runtime/asm_mips64x.s @@ -231,12 +231,14 @@ TEXT runtime·morestack(SB),NOSPLIT,$-8-0 // Cannot grow scheduler stack (m->g0). MOVV g_m(g), R7 MOVV m_g0(R7), R8 - BNE g, R8, 2(PC) + BNE g, R8, 3(PC) + JAL runtime·badmorestackg0(SB) JAL runtime·abort(SB) // Cannot grow signal stack (m->gsignal). MOVV m_gsignal(R7), R8 - BNE g, R8, 2(PC) + BNE g, R8, 3(PC) + JAL runtime·badmorestackgsignal(SB) JAL runtime·abort(SB) // Called from f. |