mirror of
https://github.com/golang/go
synced 2024-11-25 03:17:58 -07:00
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
This commit is contained in:
parent
a0368180a7
commit
68b0a87966
@ -453,11 +453,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:
|
||||
|
@ -179,11 +179,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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user