# HG changeset patch # User roland # Date 1328691144 -3600 # Node ID c742b0b47fe5e8ac4862c4868b6876cf5548e947 # Parent b9bc6cae88f266e728aae5b31d8b0ce683d1639b 7119286: JSR292: SIGSEGV in JNIHandleBlock::release_block(JNIHandleBlock*, Thread*)+0x3c Summary: unaligned stack in throw_NullPointerException_at_call_entry(). Reviewed-by: twisti, never, kvn diff -r b9bc6cae88f2 -r c742b0b47fe5 src/cpu/x86/vm/stubGenerator_x86_64.cpp --- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Tue Feb 07 16:33:43 2012 -0800 +++ b/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