aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/linux
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-07-30 11:32:55 -0700
committerRuss Cox <rsc@golang.org>2010-07-30 11:32:55 -0700
commit68b0a87966e64d8f851257e89571d676d5c6e0cd (patch)
treee30065aa945cf0268eeb99eeef4732dcc2961a13 /src/pkg/runtime/linux
parenta0368180a7853f6ada2cea6c41bed2bb2fb2de15 (diff)
downloadgo-68b0a87966e64d8f851257e89571d676d5c6e0cd.tar.xz
runtime: do not fall through in SIGBUS/SIGSEGV
Faults beyond the first page are not expected and should fail loudly. They are not subject to recover. R=r CC=golang-dev https://golang.org/cl/1915042
Diffstat (limited to 'src/pkg/runtime/linux')
-rw-r--r--src/pkg/runtime/linux/thread.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pkg/runtime/linux/thread.c b/src/pkg/runtime/linux/thread.c
index a849125f94..47bf3428f7 100644
--- a/src/pkg/runtime/linux/thread.c
+++ b/src/pkg/runtime/linux/thread.c
@@ -279,11 +279,13 @@ sigpanic(void)
case SIGBUS:
if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000)
panicstring("invalid memory address or nil pointer dereference");
- break;
+ printf("unexpected fault address %p\n", g->sigcode1);
+ throw("fault");
case SIGSEGV:
if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
panicstring("invalid memory address or nil pointer dereference");
- break;
+ printf("unexpected fault address %p\n", g->sigcode1);
+ throw("fault");
case SIGFPE:
switch(g->sigcode0) {
case FPE_INTDIV: