Review request: 8043086 : Hotspot is expected to report OOM which is occurred String.intern(), but crashes in JDK8u5

Poonam Bajaj poonam.bajaj at oracle.com
Wed May 28 09:27:15 UTC 2014


Hi David,

On 5/28/2014 10:54 AM, David Holmes wrote:
> Hi Poonam,
>
> On 28/05/2014 12:20 PM, Poonam Bajaj wrote:
>> Hi,
>>
>> Request for reviews for the following fix:
>> Bug: 8043086 <https://bugs.openjdk.java.net/browse/JDK-8043086>: Hotspot
>> is expected to report OOM which is occurred String.intern(), but crashes
>> in JDK8u5
>> Webrev: http://cr.openjdk.java.net/~poonam/8043086/webrev.00/
>>
>> Fix details: Bug  'JDK-8011773: Some tests on Interned String crashed
>> JVM with OOM' was fixed in JDK 8.  But with this fix another crash
>> happens while throwing java.lang.OutOfMemoryError exception when an out
>> of memory error occurs in String.intern(). The reason being in case of
>> an allocation failure, the _chunk of ResourceMark could be left null and
>> that can cause crash in the destructor of ResourceMark. These changes
>> fix that.
>
> You already have a "tmp" copy of chunk_, so this should suffice as a fix:
>
>  562   Chunk *k = _chunk;            // Get filled-up chunk address
>  563   _chunk = new (alloc_failmode, len) Chunk(len);
>  564
>  565   if (_chunk == NULL) {
>
> +        _chunk = k;  // restore
>
>  566     return NULL;
>  567   }

Yes, of course. Much cleaner and shorter change. Thanks. I will update 
the webrev.

regards,
Poonam

>
> David
> -----
>
>> Thanks,
>> Poonam
>>


More information about the hotspot-runtime-dev mailing list