< prev index next >
src/os/linux/vm/vmError_linux.cpp
Print this page
rev 7905 : 8074552: SafeFetch32 and SafeFetchN do not work in error handling
Summary: handle SafeFetch faults in secondary signal handlers
Contributed-by: Thomas Stuefe
@@ -110,11 +110,20 @@
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);
+ // support safefetch faults in error handling
+ ucontext_t* const uc = (ucontext_t*) ucVoid;
+ address const pc = uc ? os::Linux::ucontext_get_pc(uc) : NULL;
+
+ if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
+ os::Linux::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 >