--- old/src/os/bsd/vm/vmError_bsd.cpp 2015-03-10 17:59:08.062632000 +0100 +++ new/src/os/bsd/vm/vmError_bsd.cpp 2015-03-10 17:59:07.898631000 +0100 @@ -112,7 +112,16 @@ } pthread_sigmask(SIG_UNBLOCK, &newset, NULL); - VMError err(NULL, sig, NULL, info, ucVoid); + // support safefetch faults in error handling + ucontext_t* const uc = (ucontext_t*) ucVoid; + address const pc = uc ? os::Bsd::ucontext_get_pc(uc) : NULL; + + if (uc && pc && StubRoutines::is_safefetch_fault(pc)) { + os::Bsd::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc)); + return; + } + + VMError err(NULL, sig, pc, info, ucVoid); err.report_and_die(); }