Merge
authorcoleenp
Wed, 05 Apr 2017 01:11:25 +0000
changeset 46363 b53de34a044c
parent 46362 974737822190 (current diff)
parent 46361 b4c026dd6128 (diff)
child 46364 00a21c0ff97e
child 46365 d79745f72ae6
Merge
--- a/hotspot/src/os/posix/vm/vmError_posix.cpp	Tue Apr 04 21:07:19 2017 -0400
+++ b/hotspot/src/os/posix/vm/vmError_posix.cpp	Wed Apr 05 01:11:25 2017 +0000
@@ -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));
--- a/hotspot/src/os_cpu/linux_s390/vm/os_linux_s390.cpp	Tue Apr 04 21:07:19 2017 -0400
+++ b/hotspot/src/os_cpu/linux_s390/vm/os_linux_s390.cpp	Wed Apr 05 01:11:25 2017 +0000
@@ -505,6 +505,14 @@
   sigaddset(&newset, sig);
   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 
+  // Hand down correct pc for SIGILL, SIGFPE. pc from context
+  // usually points to the instruction after the failing instruction.
+  // Note: this should be combined with the trap_pc handling above,
+  // because it handles the same issue.
+  if (sig == SIGILL || sig == SIGFPE) {
+    pc = (address) info->si_addr;
+  }
+
   VMError::report_and_die(t, sig, pc, info, ucVoid);
 
   ShouldNotReachHere();