8160411: SIGSEGV in frame::safe_for_sender on incomplete DeoptimizationBlob frame
authordlong
Fri, 21 Oct 2016 17:51:33 -0700
changeset 42042 681bd315c66e
parent 42041 f316fd20ed98
child 42043 bf17eb48ea3f
8160411: SIGSEGV in frame::safe_for_sender on incomplete DeoptimizationBlob frame Summary: add range check for sender_sp Reviewed-by: aph, dcubed
hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp
hotspot/src/cpu/x86/vm/frame_x86.cpp
--- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp	Fri Oct 21 13:07:32 2016 -0700
+++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp	Fri Oct 21 17:51:33 2016 -0700
@@ -142,6 +142,10 @@
       }
 
       sender_sp = _unextended_sp + _cb->frame_size();
+      // Is sender_sp safe?
+      if ((address)sender_sp >= thread->stack_base()) {
+        return false;
+      }
       sender_unextended_sp = sender_sp;
       sender_pc = (address) *(sender_sp-1);
       // Note: frame::sender_sp_offset is only valid for compiled frame
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 21 13:07:32 2016 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 21 17:51:33 2016 -0700
@@ -140,6 +140,10 @@
       }
 
       sender_sp = _unextended_sp + _cb->frame_size();
+      // Is sender_sp safe?
+      if ((address)sender_sp >= thread->stack_base()) {
+        return false;
+      }
       sender_unextended_sp = sender_sp;
       // On Intel the return_address is always the word on the stack
       sender_pc = (address) *(sender_sp-1);