RFR (S) 6424123: JVM crashes on failed 'strdup' call.

Zhengyu Gu zhengyu.gu at oracle.com
Thu Jun 5 13:14:36 UTC 2014


My bad. I got where allocation handles OOM wrong, I were thinking 
AllocateHeap equivalent.

Thanks,

-Zhengyu

On 6/5/2014 7:49 AM, David Holmes wrote:
> On 5/06/2014 6:32 AM, Zhengyu Gu wrote:
>> JVM should avoid C library's strdup() and use os::strdup() instead.
>> os::strdup() handles OOM, so can avoid JVM crash.
>
> Sorry but I don't see how changing one function that can return NULL 
> for another that can return NULL makes a difference. The caller of 
> strdup/os::strdup has to check the result for NULL.
>
> What am I missing???
>
> David
>
>> Also, made limited scope of code cleanup, which makes memory ownership
>> more explicit, so they can be claimed by object's destructors.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-6424123
>> Webrev: http://cr.openjdk.java.net/~zgu/6424123/webrev.00/
>>
>> Tests:
>>    - JPRT
>>    - vm.quick.testlist on Linux x64.
>>
>> Thanks,
>>
>> -Zhengyu



More information about the hotspot-runtime-dev mailing list