RFR (S) JDK-8162553: Crash in class unloading due to null CLD having a zero _keep_alive value

Lois Foltan lois.foltan at oracle.com
Mon Aug 8 19:41:41 UTC 2016


Hello,

Please review the following fix:

Webrev:
http://cr.openjdk.java.net/~lfoltan/bug_jdk8162553/webrev/

Bug: Crash in class unloading due to null CLD having a zero _keep_alive 
value
https://bugs.openjdk.java.net/browse/JDK-8162553

Summary:
Limit the increment/decrement of the ClassLoaderData _keep_alive field 
to just ClassLoaderData(s) created specifically for an anonymous class.  
Due to the uniqueness that no other class shares an anonymous class' 
ClassLoaderData, no other non-GC thread has knowledge of the anonymous 
class while it is being defined.  By limiting the increment/decrement to 
just ClassLoaderData(s) dedicated to anonymous classes, the need to make 
this an atomic operation is avoided.  This bug was exposed since 
java_lang_Class::create_mirror() is multi-threaded once java.lang.Class 
is loaded during JVM start up.

Testing:
Several runs of hotspot nightly testing and several iterations of 
various tests that have exposed this issue.

Thanks,
Lois


More information about the hotspot-dev mailing list