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

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Nov 24 13:11:16 UTC 2015


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.


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