RFR(xs): 8220173: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark

Daniel D. Daugherty daniel.daugherty at oracle.com
Thu Mar 7 15:21:06 UTC 2019

On 3/7/19 6:21 AM, Robbin Ehn wrote:
> Hi all, please review.
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8220173
> Webrev:
> http://cr.openjdk.java.net/~rehn/8220173/webrev/

     L297:     HandleMark hm;
         This should be "HandleMark hm(thread);".

I only took a quick look at clear_handshake() and do_handshake(), but
I'm not grokking the reason for the CautiouslyPreserveExceptionMark
helper. You use those when you want to preserve a possible pending
exception that you have in hand now when you're about to execute code
that might generate another (unexpected) exception. I'm not seeing
where clear_handshake() or do_handshake() are doing anything that
might generate another Java exception. However, I only took a quick
look so maybe I missed something. So what am I missing?

Thumbs up on the change itself. Would be good to know the answer to
my question above.


> A thread have a pending exception and we try to handleize the oop 
> without a HandleMark before the handshake.
> The CautiouslyPreserveExceptionMark should only cover the handshake 
> operation not the transition, so moved that into proper scope and 
> added HandleMark.
> Passes t1.
> Thanks Robbin

More information about the hotspot-runtime-dev mailing list