On systems where the mmap succeeds
(e.g., sysctl -w vm.mmap_min_addr=0)
it changes the signal code delivered for a
nil fault from ``page not mapped'' to
``invalid permissions for page.''
TBR=r
CC=golang-dev
https://golang.org/cl/
2294041
printf("unexpected fault address %p\n", g->sigcode1);
throw("fault");
case SIGSEGV:
- if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
+ if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000)
panicstring("invalid memory address or nil pointer dereference");
printf("unexpected fault address %p\n", g->sigcode1);
throw("fault");
printf("unexpected fault address %p\n", g->sigcode1);
throw("fault");
case SIGSEGV:
- if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
+ if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000)
panicstring("invalid memory address or nil pointer dereference");
printf("unexpected fault address %p\n", g->sigcode1);
throw("fault");
}
void
-destroylock(Lock *l)
+destroylock(Lock*)
{
}
printf("unexpected fault address %p\n", g->sigcode1);
throw("fault");
case SIGSEGV:
- if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR) && g->sigcode1 < 0x1000)
+ if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000)
panicstring("invalid memory address or nil pointer dereference");
printf("unexpected fault address %p\n", g->sigcode1);
throw("fault");