diff options
author | Russ Cox <rsc@golang.org> | 2013-09-11 12:00:37 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2013-09-11 12:00:37 -0400 |
commit | 427c54e637da105255db8025b9038dec646cc842 (patch) | |
tree | 8b52507f82f9f2fe1d719ec9ae504b71386c0fe8 | |
parent | 01b4e2961ea3c5b4aeef507b1e52fe6c29b86b1e (diff) | |
download | go-427c54e637da105255db8025b9038dec646cc842.tar.gz |
runtime: show m stack during crash on m stack
The various throwing > 0 finish a change started
in a previous CL, which sets throwing = -1 to mean
"don't show the internals". That gets set during the
"all goroutines are asleep - deadlock!" crash, and it
should also be set during any other expected crash
that does not indicate a problem within the runtime.
Most runtime.throw do indicate a problem within the
runtime, however, so we should be able to enumerate
the ones that should be silent. The goroutine sleeping
deadlock is the only one I can think of.
Update issue 5139
R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/13662043
-rw-r--r-- | src/pkg/runtime/panic.c | 2 | ||||
-rw-r--r-- | src/pkg/runtime/traceback_arm.c | 2 | ||||
-rw-r--r-- | src/pkg/runtime/traceback_x86.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/runtime/panic.c b/src/pkg/runtime/panic.c index 4fbbed107..c14d52016 100644 --- a/src/pkg/runtime/panic.c +++ b/src/pkg/runtime/panic.c @@ -443,7 +443,7 @@ runtime·dopanic(int32 unused) runtime·printf("\n"); runtime·goroutineheader(g); runtime·traceback((uintptr)runtime·getcallerpc(&unused), (uintptr)runtime·getcallersp(&unused), 0, g); - } else if(t >= 2) { + } else if(t >= 2 || m->throwing > 0) { runtime·printf("\nruntime stack:\n"); runtime·traceback((uintptr)runtime·getcallerpc(&unused), (uintptr)runtime·getcallersp(&unused), 0, g); } diff --git a/src/pkg/runtime/traceback_arm.c b/src/pkg/runtime/traceback_arm.c index 74725ba4c..02586f036 100644 --- a/src/pkg/runtime/traceback_arm.c +++ b/src/pkg/runtime/traceback_arm.c @@ -153,7 +153,7 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip, runtime·printf("\t%S:%d", file, line); if(frame.pc > f->entry) runtime·printf(" +%p", (uintptr)(frame.pc - f->entry)); - if(m->throwing && gp == m->curg) + if(m->throwing > 0 && gp == m->curg) runtime·printf(" fp=%p", frame.fp); runtime·printf("\n"); nprint++; diff --git a/src/pkg/runtime/traceback_x86.c b/src/pkg/runtime/traceback_x86.c index 78f8bd5aa..a18bb9a6a 100644 --- a/src/pkg/runtime/traceback_x86.c +++ b/src/pkg/runtime/traceback_x86.c @@ -170,7 +170,7 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip, runtime·printf("\t%S:%d", file, line); if(frame.pc > f->entry) runtime·printf(" +%p", (uintptr)(frame.pc - f->entry)); - if(m->throwing && gp == m->curg) + if(m->throwing > 0 && gp == m->curg) runtime·printf(" fp=%p", frame.fp); runtime·printf("\n"); nprint++; |