RFR(S) 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
Zhengyu Gu
zhengyu.gu at oracle.com
Thu Aug 14 12:33:41 UTC 2014
Thanks for the review.
On 8/14/2014 7:43 AM, Coleen Phillimore wrote:
>
> I agree. This looks good. Was it found with an existing test and/or
> would it be possible to write one?
>
It is found in existing test and I think the test is sufficient.
-Zhengyu
> Thanks,
> Coleen
>
> On 8/14/14, 6:33 AM, David Holmes wrote:
>> On 14/08/2014 5:54 AM, Zhengyu Gu wrote:
>>> The crash is caused by debugee exiting process by calling ::exit(),
>>> which causes C runtime to destroy static object
>>> (VirtualMemoryTracker::_reserved_regions) while threads still
>>> access it.
>>
>> Non-trivial static C++ objects plus multi-threading just don't mix.
>>
>>> The solution is to replace it with pointer type, allocates the object
>>> during NMT initialization and deallocate it during shutdown.
>>
>> Looks okay to me.
>>
>> Thanks,
>> David
>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8054368
>>> Webrev: http://cr.openjdk.java.net/~zgu/8054368/webrev.00/
>>> <http://cr.openjdk.java.net/%7Ezgu/8054368/webrev.00/>
>>>
>>> Test:
>>> Ran nsk/jdi/VirtualMachine/exit/exit002 in a loop for 1+ hour on
>>> Solaris x64, no crash.
>>> Without the fix, it crashes within 5 minutes.
>>>
>>>
>>> Thanks,
>>>
>>> -Zhengyu
>>>
>
More information about the hotspot-runtime-dev
mailing list