--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp Tue Mar 31 02:11:09 2015 +0000
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp Tue Mar 31 05:30:36 2015 -0400
@@ -59,6 +59,10 @@
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
+// See stubGenerator_zero.cpp
+#include <setjmp.h>
+extern sigjmp_buf* get_jmp_buf_for_continuation();
+
address os::current_stack_pointer() {
address dummy = (address) &dummy;
return dummy;
@@ -134,6 +138,14 @@
SignalHandlerMark shm(t);
+ // handle SafeFetch faults
+ if (sig == SIGSEGV || sig == SIGBUS) {
+ sigjmp_buf* const pjb = get_jmp_buf_for_continuation();
+ if (pjb) {
+ siglongjmp(*pjb, 1);
+ }
+ }
+
// Note: it's not uncommon that JNI code uses signal/sigset to
// install then restore certain signal handler (e.g. to temporarily
// block SIGPIPE, or have a SIGILL handler when detecting CPU