< prev index next >

src/os/posix/vm/vmError_posix.cpp

Print this page
rev 12858 : 8184323: compile-time guard some UseSharedSpaces-only coding with the INCLUDE_CDS macro


 110   VMError::report_and_die(NULL, sig, pc, info, ucVoid);
 111 }
 112 
 113 void VMError::reset_signal_handlers() {
 114   // install signal handlers for all synchronous program error signals
 115   sigset_t newset;
 116   sigemptyset(&newset);
 117 
 118   for (int i = 0; i < NUM_SIGNALS; i++) {
 119     save_signal(i, SIGNALS[i]);
 120     os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
 121     sigaddset(&newset, SIGNALS[i]);
 122   }
 123   os::Posix::unblock_thread_signal_mask(&newset);
 124 
 125 }
 126 
 127 // Write a hint to the stream in case siginfo relates to a segv/bus error
 128 // and the offending address points into CDS archive.
 129 void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) {

 130   if (siginfo && UseSharedSpaces) {
 131     const siginfo_t* const si = (siginfo_t*)siginfo;
 132     if (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) {
 133       const void* const fault_addr = si->si_addr;
 134       if (fault_addr != NULL) {
 135         FileMapInfo* const mapinfo = FileMapInfo::current_info();
 136         if (mapinfo->is_in_shared_space(fault_addr)) {
 137           st->print("Error accessing class data sharing archive. "
 138             "Mapped file inaccessible during execution, possible disk/network problem.");
 139         }
 140       }
 141     }
 142   }

 143 }
 144 


 110   VMError::report_and_die(NULL, sig, pc, info, ucVoid);
 111 }
 112 
 113 void VMError::reset_signal_handlers() {
 114   // install signal handlers for all synchronous program error signals
 115   sigset_t newset;
 116   sigemptyset(&newset);
 117 
 118   for (int i = 0; i < NUM_SIGNALS; i++) {
 119     save_signal(i, SIGNALS[i]);
 120     os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
 121     sigaddset(&newset, SIGNALS[i]);
 122   }
 123   os::Posix::unblock_thread_signal_mask(&newset);
 124 
 125 }
 126 
 127 // Write a hint to the stream in case siginfo relates to a segv/bus error
 128 // and the offending address points into CDS archive.
 129 void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) {
 130 #if INCLUDE_CDS
 131   if (siginfo && UseSharedSpaces) {
 132     const siginfo_t* const si = (siginfo_t*)siginfo;
 133     if (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) {
 134       const void* const fault_addr = si->si_addr;
 135       if (fault_addr != NULL) {
 136         FileMapInfo* const mapinfo = FileMapInfo::current_info();
 137         if (mapinfo->is_in_shared_space(fault_addr)) {
 138           st->print("Error accessing class data sharing archive. "
 139             "Mapped file inaccessible during execution, possible disk/network problem.");
 140         }
 141       }
 142     }
 143   }
 144 #endif
 145 }
 146 
< prev index next >