src/hotspot/os/posix/vmError_posix.cpp
changeset 49653 a569cb4425f3
parent 48794 ea0d0781c63c
child 55653 3243c42d737d
equal deleted inserted replaced
49652:a74836b05c28 49653:a569cb4425f3
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "memory/metaspaceShared.hpp"
    26 #include "memory/metaspaceShared.hpp"
    27 #include "runtime/arguments.hpp"
    27 #include "runtime/arguments.hpp"
    28 #include "runtime/os.hpp"
    28 #include "runtime/os.hpp"
    29 #include "runtime/thread.hpp"
    29 #include "runtime/thread.hpp"
       
    30 #include "utilities/debug.hpp"
    30 #include "utilities/vmError.hpp"
    31 #include "utilities/vmError.hpp"
    31 
    32 
    32 #include <sys/types.h>
    33 #include <sys/types.h>
    33 #include <sys/wait.h>
    34 #include <sys/wait.h>
    34 #include <signal.h>
    35 #include <signal.h>
   120   // Correct pc for SIGILL, SIGFPE (see JDK-8176872)
   121   // Correct pc for SIGILL, SIGFPE (see JDK-8176872)
   121   if (sig == SIGILL || sig == SIGFPE) {
   122   if (sig == SIGILL || sig == SIGFPE) {
   122     pc = (address) info->si_addr;
   123     pc = (address) info->si_addr;
   123   }
   124   }
   124 
   125 
       
   126   // Needed to make it possible to call SafeFetch.. APIs in error handling.
   125   if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
   127   if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
   126     os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
   128     os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
   127     return;
   129     return;
   128   }
   130   }
       
   131 
       
   132   // Needed because asserts may happen in error handling too.
       
   133 #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
       
   134   if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
       
   135     handle_assert_poison_fault(ucVoid, info->si_addr);
       
   136     return;
       
   137   }
       
   138 #endif // CAN_SHOW_REGISTERS_ON_ASSERT
   129 
   139 
   130   VMError::report_and_die(NULL, sig, pc, info, ucVoid);
   140   VMError::report_and_die(NULL, sig, pc, info, ucVoid);
   131 }
   141 }
   132 
   142 
   133 void VMError::reset_signal_handlers() {
   143 void VMError::reset_signal_handlers() {