< prev index next >

src/os/aix/vm/vmError_aix.cpp

Print this page
rev 7970 : 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

@@ -107,11 +107,19 @@
   for (int i = 0; i < NUM_SIGNALS; i++) {
     sigaddset(&newset, SIGNALS[i]);
   }
   sigthreadmask(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::Aix::ucontext_get_pc(uc) : NULL;
+  if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
+    os::Aix::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() {
   sigset_t newset;
< prev index next >