[11] RFR(XS): 8198826: -XX:+VerifyStack fails with fatal error: ExceptionMark constructor expects no pending exceptions

David Holmes david.holmes at oracle.com
Wed Feb 28 21:53:44 UTC 2018


Hi Tobias,

On 1/03/2018 12:21 AM, Tobias Hartmann wrote:
> Hi,
> 
> please review the following patch:
> https://bugs.openjdk.java.net/browse/JDK-8198826
> http://cr.openjdk.java.net/~thartmann/8198826/webrev.00/
> 
> If an OutOfMemoryError is thrown during reallocation of scalar replaced objects, stack verification
> crashes after calling OopMapCache::compute_one_oop_map because that code does not expect pending
> exceptions. Please note that the exception is not thrown in that method but earlier in
> Deoptimization::realloc_objects() and then propagated through the deoptimization blob.
> 
> I propose to skip stack verification in this exceptional case.

Once an exception is pending code has to be very careful about how it 
proceeds - both in terms of "the previous action failed so what do I do 
now?" and "I've got a pending exception so need to be very careful about 
what I call".

I'm not familiar with this code at all and looking at it it is very hard 
for me to understand exactly what the occurrence of the OOME means for 
the rest of the code. Normally I would expect to see code "bail out" as 
soon as possible, while this code seems to continue to do lots of 
(presumably necessary) things.

My concern with this simple fix is that if the occurrence of the OOME 
has actually resulted in breakage, then skipping the VerifyStack logic 
may be skipping the code that would detect that breakage. In which case 
it may be better to save and clear the exception and restore it afterwards.

But this isn't my code area and I may be jumping at shadows, so will 
defer to more knowledgeable reviewers.

Thanks,
David

> Thanks,
> Tobias
> 


More information about the hotspot-dev mailing list