review for 7088020: SEGV in JNIHandleBlock::release_block

Tom Rodriguez tom.rodriguez at
Thu Sep 8 09:29:02 PDT 2011

On Sep 8, 2011, at 3:09 AM, Christian Thalinger wrote:

> I don't understand that comment:
> +     // FIXME: this probably needs to alignment logic

It's a typo in a comment John asked me to add.  The unsafe handler also needs alignment but I wasn't sure how to reproduce a failure so I didn't want to touch it.

To be honest my whole change make me a little nervous.  The current stubs all apparently work ok which suggests they are always called from contexts that are properly aligned.  The only way to do alignment is to extend the caller frame, which is really only safe in some contexts.  It should always be safe to adjust SP in the method handle code calls so I think I should just do some stack alignment just before jumping to the throw_WMTE_entry.  Part of the problem is that we don't have any strict alignment checks when calling into the runtime.  We just happen to die because the part of the JNI code was using movdqa against rbp.  Anyway, I'm going to play with this a bit more.


> -- Christian
> On Sep 8, 2011, at 5:40 AM, Tom Rodriguez wrote:
>> Strangely the WMT cases all seemed to work fine but another test was failing.  Running with +WalkStackALot showed that I wasn't moving the return address so I propagated the frame adjustment outside the enter/leave.
>> tom
>> On Sep 7, 2011, at 2:24 PM, Vladimir Kozlov wrote:
>>> Where r12 is restored? It contains coop base.
>>> Vladimir
>>> Tom Rodriguez wrote:
>>>> 150 lines changed: 88 ins; 50 del; 12 mod; 10143 unchg
>>>> 7088020: SEGV in JNIHandleBlock::release_block
>>>> Reviewed-by:
>>>> The throw_WrongMethodTypeException stub on x64 needs to align the
>>>> stack before calling into the runtime or it might crash.  I also
>>>> noticed that two stubs were dead which made an extra argument dead so
>>>> I cleaned that up at the same time.  Tested on linux-amd64 with new
>>>> regression test and failing tests from report.

More information about the hotspot-compiler-dev mailing list