RFR (S) JDK-8007725 - Klass::restore_unshareable_info() triggers assert(k->java_mirror() == NULL)

Ioi Lam ioi.lam at oracle.com
Mon Mar 11 12:47:21 PDT 2013


Please review:
http://cr.openjdk.java.net/~iklam/8007725/null_mirror_001/

Bug: NPG: Klass::restore_unshareable_info() triggers
     assert(k->java_mirror() == NULL)

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8007725
  or https://jbs.oracle.com/bugs/browse/JDK-8007725

     (The bugs.sun.com page may be unavailable for a couple of days due
      to recent change of confidentiality status.)

Summary of fix:

     The assert is at:

     --------
     # Internal Error (src/share/vm/classfile/javaClasses.cpp:527)
     # assert(k->java_mirror() == NULL) failed: should only assign 
mirror once
     java_lang_Class::create_mirror(KlassHandle)
     Klass::restore_unshareable_info()
     InstanceKlass::restore_unshareable_info()
     instanceKlassHandle 
SystemDictionary::load_shared_class(instanceKlassHandle,Handle)
     --------

     This happens if during class loading, an OOM happened after
     Klass::restore_unshareable_info() has called
     java_lang_Class::create_mirror(), but before the class loading is 
completed.

     At this point, the class is not in the system dictionary. However the
     Klass structure is partially initialized.

     If the app tries to load the same class again, the assert happens.

     The fix is to undo all work performed by
     InstanceKlass::restore_unshareable_info().

Tests executed:

     * JPRT
     * JCK (vm, lang, api/signaturetest)
     * UTE (vm.quick.testlist, )

Thanks,
Ioi


More information about the hotspot-runtime-dev mailing list