Commit 81041369 authored by Russ Cox's avatar Russ Cox

runtime: fix build

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
parent 649aab83
......@@ -456,7 +456,7 @@ sigpanic(void)
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");
......
......@@ -182,7 +182,7 @@ sigpanic(void)
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");
......
......@@ -168,7 +168,7 @@ unlock(Lock *l)
}
void
destroylock(Lock *l)
destroylock(Lock*)
{
}
......@@ -282,7 +282,7 @@ sigpanic(void)
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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment