[9] RFR (S): 8143408: Crash during InstanceKlass unloading when clearing dependency context

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Nov 24 19:08:12 UTC 2015


Thanks, Vladimir.

Best regards,
Vladimir Ivanov

On 11/24/15 9:28 PM, Vladimir Kozlov wrote:
> Looks fine.
>
> Thanks,
> Vladimir
>
> On 11/24/15 5:11 AM, Vladimir Ivanov wrote:
>> http://cr.openjdk.java.net/~vlivanov/8143408/webrev.00
>> https://bugs.openjdk.java.net/browse/JDK-8143408
>>
>> The fix for 8139595 [1] assumed that there shouldn't be any valid
>> dependencies on a klass being unloaded (see changes in
>> IK::release_C_heap_structures()). Only stale entries were accepted.
>>
>> Unfortunately, it's not the case. The problem is that the klass
>> dependency context can contain live dependencies, since
>> there's a race between nmethod & klass unloading. If the klass is dead
>> when nmethod unloading happens, relevant
>> dependencies aren't removed from the context associated with the class
>> (see nmethod::flush_dependencies). It ends up
>> during klass unloading as seemingly live dependencies pointing to
>> unloaded nmethods and causes a crash in
>> DC::remove_all_dependents() when it touches unloaded nmethod.
>>
>> The fix is to revert IK::release_C_heap_structures() to pre-8139595
>> state: deallocate all entries w/o consulting their
>> state (DC::wipe()).
>>
>> Testing: jprt.
>>
>> Thanks!
>>
>> Best regards,
>> Vladimir Ivanov
>>
>> [1] http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/09ac9142d6ef


More information about the hotspot-compiler-dev mailing list