aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-09-28 20:50:00 -0400
committerRuss Cox <rsc@golang.org>2010-09-28 20:50:00 -0400
commit81041369b29b5f8910b559819512c57d3d86e034 (patch)
tree87478414525cbbed6592f9355907f7871ffe05bb
parent649aab835fc8e0fef8e0456396378ed1495d41bd (diff)
downloadgo-81041369b29b5f8910b559819512c57d3d86e034.tar.gz
go-81041369b29b5f8910b559819512c57d3d86e034.zip
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
-rw-r--r--src/pkg/runtime/darwin/thread.c2
-rw-r--r--src/pkg/runtime/freebsd/thread.c2
-rw-r--r--src/pkg/runtime/linux/thread.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/runtime/darwin/thread.c b/src/pkg/runtime/darwin/thread.c
index 6f64c08738..f4dd180122 100644
--- a/src/pkg/runtime/darwin/thread.c
+++ b/src/pkg/runtime/darwin/thread.c
@@ -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");
diff --git a/src/pkg/runtime/freebsd/thread.c b/src/pkg/runtime/freebsd/thread.c
index c9c058c5ae..27f8aa5ff5 100644
--- a/src/pkg/runtime/freebsd/thread.c
+++ b/src/pkg/runtime/freebsd/thread.c
@@ -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");
diff --git a/src/pkg/runtime/linux/thread.c b/src/pkg/runtime/linux/thread.c
index 47bf3428f7..f31838ea50 100644
--- a/src/pkg/runtime/linux/thread.c
+++ b/src/pkg/runtime/linux/thread.c
@@ -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");