< prev index next >

src/os/aix/vm/vmError_aix.cpp

Print this page




 100 static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
 101 
 102   // Unmask current signal.
 103   sigset_t newset;
 104   sigemptyset(&newset);
 105   sigaddset(&newset, sig);
 106   // and all other synchronous signals too.
 107   for (int i = 0; i < NUM_SIGNALS; i++) {
 108     sigaddset(&newset, SIGNALS[i]);
 109   }
 110   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 111 
 112   // support safefetch faults in error handling
 113   ucontext_t* const uc = (ucontext_t*) ucVoid;
 114   address const pc = uc ? os::Aix::ucontext_get_pc(uc) : NULL;
 115   if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
 116     os::Aix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
 117     return;
 118   }
 119 
 120   VMError err(NULL, sig, pc, info, ucVoid);
 121   err.report_and_die();
 122 }
 123 
 124 void VMError::reset_signal_handlers() {
 125   sigset_t newset;
 126   sigemptyset(&newset);
 127 
 128   for (int i = 0; i < NUM_SIGNALS; i++) {
 129     save_signal(i, SIGNALS[i]);
 130     os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
 131     sigaddset(&newset, SIGNALS[i]);
 132   }
 133 
 134   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 135 }


 100 static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
 101 
 102   // Unmask current signal.
 103   sigset_t newset;
 104   sigemptyset(&newset);
 105   sigaddset(&newset, sig);
 106   // and all other synchronous signals too.
 107   for (int i = 0; i < NUM_SIGNALS; i++) {
 108     sigaddset(&newset, SIGNALS[i]);
 109   }
 110   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 111 
 112   // support safefetch faults in error handling
 113   ucontext_t* const uc = (ucontext_t*) ucVoid;
 114   address const pc = uc ? os::Aix::ucontext_get_pc(uc) : NULL;
 115   if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
 116     os::Aix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
 117     return;
 118   }
 119 
 120   VMError::report_and_die(NULL, sig, pc, info, ucVoid);

 121 }
 122 
 123 void VMError::reset_signal_handlers() {
 124   sigset_t newset;
 125   sigemptyset(&newset);
 126 
 127   for (int i = 0; i < NUM_SIGNALS; i++) {
 128     save_signal(i, SIGNALS[i]);
 129     os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
 130     sigaddset(&newset, SIGNALS[i]);
 131   }
 132 
 133   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 134 }
< prev index next >