hotspot/src/os/posix/vm/vmError_posix.cpp
changeset 46361 b4c026dd6128
parent 46284 ad578adff5df
child 46689 59f0972cf342
--- 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));