diff options
| author | Russ Cox <rsc@golang.org> | 2014-04-03 19:05:59 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-04-03 19:05:59 -0400 |
| commit | 4110271501f901f53d987fe3a0a0f832b883c8b4 (patch) | |
| tree | b402e10d27061cb057546a3976fbfbc1805e28d8 /src/pkg/runtime/os_linux.c | |
| parent | f5f5a8b6209f84961687d993b93ea0d397f5d5bf (diff) | |
| download | go-4110271501f901f53d987fe3a0a0f832b883c8b4.tar.xz | |
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
Diffstat (limited to 'src/pkg/runtime/os_linux.c')
| -rw-r--r-- | src/pkg/runtime/os_linux.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |
