From 2fb87ddb59218797686f8d725a5accb195ccbaca Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Fri, 7 Mar 2014 00:01:24 +0400 Subject: [PATCH] runtime: print goroutine header on fault I've just needed the G status on fault to debug runtime bug. For some reason we print everything except header here. Make it more informative and consistent. R=rsc CC=golang-codereviews https://golang.org/cl/67870056 --- src/pkg/runtime/signal_386.c | 1 + src/pkg/runtime/signal_amd64.c | 1 + src/pkg/runtime/signal_arm.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/pkg/runtime/signal_386.c b/src/pkg/runtime/signal_386.c index 9f3f52179c..829f389cc2 100644 --- a/src/pkg/runtime/signal_386.c +++ b/src/pkg/runtime/signal_386.c @@ -112,6 +112,7 @@ Throw: runtime·printf("\n"); if(runtime·gotraceback(&crash)){ + runtime·goroutineheader(gp); runtime·traceback(SIG_EIP(info, ctxt), SIG_ESP(info, ctxt), 0, gp); runtime·tracebackothers(gp); runtime·printf("\n"); diff --git a/src/pkg/runtime/signal_amd64.c b/src/pkg/runtime/signal_amd64.c index 2184b7f64b..01af0e7edf 100644 --- a/src/pkg/runtime/signal_amd64.c +++ b/src/pkg/runtime/signal_amd64.c @@ -122,6 +122,7 @@ Throw: runtime·printf("\n"); if(runtime·gotraceback(&crash)){ + runtime·goroutineheader(gp); runtime·traceback(SIG_RIP(info, ctxt), SIG_RSP(info, ctxt), 0, gp); runtime·tracebackothers(gp); runtime·printf("\n"); diff --git a/src/pkg/runtime/signal_arm.c b/src/pkg/runtime/signal_arm.c index 4f797346c8..563f1f2bef 100644 --- a/src/pkg/runtime/signal_arm.c +++ b/src/pkg/runtime/signal_arm.c @@ -112,6 +112,7 @@ Throw: runtime·printf("\n"); if(runtime·gotraceback(&crash)){ + runtime·goroutineheader(gp); runtime·traceback(SIG_PC(info, ctxt), SIG_SP(info, ctxt), SIG_LR(info, ctxt), gp); runtime·tracebackothers(gp); runtime·printf("\n");