diff -r c753322134b0 -r b4c026dd6128 hotspot/src/os/posix/vm/vmError_posix.cpp --- a/hotspot/src/os/posix/vm/vmError_posix.cpp Fri Mar 17 19:05:45 2017 +0100 +++ b/hotspot/src/os/posix/vm/vmError_posix.cpp Tue Mar 21 14:14:06 2017 +0100 @@ -115,7 +115,12 @@ // support safefetch faults in error handling ucontext_t* const uc = (ucontext_t*) ucVoid; - address const pc = uc ? os::Posix::ucontext_get_pc(uc) : NULL; + address pc = (uc != NULL) ? os::Posix::ucontext_get_pc(uc) : NULL; + + // Correct pc for SIGILL, SIGFPE (see JDK-8176872) + if (sig == SIGILL || sig == SIGFPE) { + pc = (address) info->si_addr; + } if (uc && pc && StubRoutines::is_safefetch_fault(pc)) { os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));