mirror of
https://github.com/golang/go
synced 2024-11-21 15:04:44 -07:00
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
This commit is contained in:
parent
649aab835f
commit
81041369b2
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user