7119286: JSR292: SIGSEGV in JNIHandleBlock::release_block(JNIHandleBlock*, Thread*)+0x3c
authorroland
Wed, 08 Feb 2012 09:52:24 +0100
changeset 11725 49d1e1f1421f
parent 11724 1500e51fdcbf
child 11726 865be7387332
7119286: JSR292: SIGSEGV in JNIHandleBlock::release_block(JNIHandleBlock*, Thread*)+0x3c Summary: unaligned stack in throw_NullPointerException_at_call_entry(). Reviewed-by: twisti, never, kvn
hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Tue Feb 07 16:33:43 2012 -0800
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Wed Feb 08 09:52:24 2012 +0100
@@ -2978,7 +2978,9 @@
     int frame_complete = __ pc() - start;
 
     // Set up last_Java_sp and last_Java_fp
-    __ set_last_Java_frame(rsp, rbp, NULL);
+    address the_pc = __ pc();
+    __ set_last_Java_frame(rsp, rbp, the_pc);
+    __ andptr(rsp, -(StackAlignmentInBytes));    // Align stack
 
     // Call runtime
     if (arg1 != noreg) {
@@ -2997,7 +2999,7 @@
 
     oop_maps->add_gc_map(__ pc() - start, map);
 
-    __ reset_last_Java_frame(true, false);
+    __ reset_last_Java_frame(true, true);
 
     __ leave(); // required for proper stackwalking of RuntimeStub frame