< prev index next >

src/os/windows/vm/vmError_windows.cpp

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


  34 }
  35 
  36 address VMError::get_resetted_sighandler(int sig) {
  37   return NULL;
  38 }
  39 
  40 LONG WINAPI crash_handler(struct _EXCEPTION_POINTERS* exceptionInfo) {
  41   DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode;
  42   VMError::report_and_die(NULL, exception_code, NULL, exceptionInfo->ExceptionRecord,
  43                           exceptionInfo->ContextRecord);
  44   return EXCEPTION_CONTINUE_SEARCH;
  45 }
  46 
  47 void VMError::reset_signal_handlers() {
  48   SetUnhandledExceptionFilter(crash_handler);
  49 }
  50 
  51 // Write a hint to the stream in case siginfo relates to a segv/bus error
  52 // and the offending address points into CDS archive.
  53 void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) {

  54   if (siginfo && UseSharedSpaces) {
  55     const EXCEPTION_RECORD* const er = (const EXCEPTION_RECORD*)siginfo;
  56     if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR &&
  57         er->NumberParameters >= 2) {
  58       const void* const fault_addr = (const void*) er->ExceptionInformation[1];
  59       if (fault_addr != NULL) {
  60         FileMapInfo* const mapinfo = FileMapInfo::current_info();
  61         if (mapinfo->is_in_shared_space(fault_addr)) {
  62           st->print("Error accessing class data sharing archive. "
  63             "Mapped file inaccessible during execution, possible disk/network problem.");
  64       }
  65     }
  66     }
  67   }

  68 }


  34 }
  35 
  36 address VMError::get_resetted_sighandler(int sig) {
  37   return NULL;
  38 }
  39 
  40 LONG WINAPI crash_handler(struct _EXCEPTION_POINTERS* exceptionInfo) {
  41   DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode;
  42   VMError::report_and_die(NULL, exception_code, NULL, exceptionInfo->ExceptionRecord,
  43                           exceptionInfo->ContextRecord);
  44   return EXCEPTION_CONTINUE_SEARCH;
  45 }
  46 
  47 void VMError::reset_signal_handlers() {
  48   SetUnhandledExceptionFilter(crash_handler);
  49 }
  50 
  51 // Write a hint to the stream in case siginfo relates to a segv/bus error
  52 // and the offending address points into CDS archive.
  53 void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) {
  54 #if INCLUDE_CDS
  55   if (siginfo && UseSharedSpaces) {
  56     const EXCEPTION_RECORD* const er = (const EXCEPTION_RECORD*)siginfo;
  57     if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR &&
  58         er->NumberParameters >= 2) {
  59       const void* const fault_addr = (const void*) er->ExceptionInformation[1];
  60       if (fault_addr != NULL) {
  61         FileMapInfo* const mapinfo = FileMapInfo::current_info();
  62         if (mapinfo->is_in_shared_space(fault_addr)) {
  63           st->print("Error accessing class data sharing archive. "
  64             "Mapped file inaccessible during execution, possible disk/network problem.");
  65         }
  66       }
  67     }
  68   }
  69 #endif
  70 }
< prev index next >