mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
3 changed files with 12 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue