From 4110271501f901f53d987fe3a0a0f832b883c8b4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 3 Apr 2014 19:05:59 -0400 Subject: runtime: handle fault during runtime more like unexpected fault address Delaying the runtime.throw until here will print more information. In particular it will print the signal and code values, which means it will show the fault address. The canpanic checks were added recently, in CL 75320043. They were just not added in exactly the right place. LGTM=iant R=dvyukov, iant CC=golang-codereviews https://golang.org/cl/83980043 --- src/pkg/runtime/os_linux.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pkg/runtime/os_linux.c') diff --git a/src/pkg/runtime/os_linux.c b/src/pkg/runtime/os_linux.c index b4be9406ec..8a945242b9 100644 --- a/src/pkg/runtime/os_linux.c +++ b/src/pkg/runtime/os_linux.c @@ -218,6 +218,9 @@ runtime·unminit(void) void runtime·sigpanic(void) { + if(!runtime·canpanic(g)) + runtime·throw("unexpected signal during runtime execution"); + switch(g->sig) { case SIGBUS: if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) { -- cgit v1.3-5-g9baa