< prev index next >
src/os/bsd/vm/vmError_bsd.cpp
Print this page
rev 7968 : 8074552: SafeFetch32 and SafeFetchN do not work in error handling
Summary: handle SafeFetch faults in secondary signal handlers
Reviewed-by: dholmes
Contributed-by: Thomas Stuefe
*** 110,120 ****
for (int i = 0; i < NUM_SIGNALS; i++) {
sigaddset(&newset, SIGNALS[i]);
}
pthread_sigmask(SIG_UNBLOCK, &newset, NULL);
! VMError err(NULL, sig, NULL, info, ucVoid);
err.report_and_die();
}
void VMError::reset_signal_handlers() {
// install signal handlers for all synchronous program error signals
--- 110,129 ----
for (int i = 0; i < NUM_SIGNALS; i++) {
sigaddset(&newset, SIGNALS[i]);
}
pthread_sigmask(SIG_UNBLOCK, &newset, NULL);
! // 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();
}
void VMError::reset_signal_handlers() {
// install signal handlers for all synchronous program error signals
< prev index next >