JDK-8054402 : "klass->is_loader_alive(_is_alive)) failed: must be alive" for anonymous classes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: generic
  • Submitted: 2014-08-06
  • Updated: 2019-08-08
  • Resolved: 2014-08-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b29Fixed
Related Reports
Relates :  
Relates :  
Description
JDK-8029443 was caused by a C2 bug specific to Sparc but the same error rarely occurs on other platforms as well.

ILW = MLH = P3
Comments
The error is in 'SystemDictionary::do_unloading'. First, 'ClassLoaderDataGraph::do_unloading ' is invoked to remove the class loader data of unloaded classes. Next, 'Dictionary::do_unloading' is called to remove the system dictionary entries of dead classes. 'unloading_occurred' is only set to true if dead class loaders were found _and_ entries were removed from the system dictionary. The problem is that anonymous classes are not in the system dictionary. In the rare case where only anonymous classes were unloaded, 'unloading_occurred' is set to false even if (anonymous) class unloading occurred.
12-08-2014

Compiled method (c1) 56696 4091 java.util.stream.Streams$RangeIntSpliterator::forEachRemaining (65 bytes) #### Unloaded Klass referenced by compiled IC #### java.util.stream.StreamSpliterators$IntWrappingSpliterator$$Lambda$168/18322370 {0xe7023098} - instance size: 4 - klass size: 110 - access: final synchronized synthetic - state: fully_initialized - name: 'java/util/stream/StreamSpliterators$IntWrappingSpliterator$$Lambda$168' - super: 'java/lang/Object' - sub: - arrays: NULL - methods: Array<T>(0xe7022f08) - method ordering: Array<T>(0xebfb4928) - default_methods: Array<T>(0xe7023250) - default vtable indices: Array<T>(0xe70232c0) - local interfaces: Array<T>(0xe7022ee0) - trans. interfaces: Array<T>(0xe7023080) - constants: constant pool [27] {0xe7022e40} for 'java/util/stream/StreamSpliterator\ s$IntWrappingSpliterator$$Lambda$168' cache=0xe7023278 - class loader data: NULL class_loader - host class: 'java/util/stream/StreamSpliterators$IntWrappingSpliterator' - class annotations: Array<T>(0x00000000) - class type annotations: Array<T>(0x00000000) - field annotations: Array<T>(0x00000000) - field type annotations: Array<T>(0x00000000) - inner classes: Array<T>(0xebfb4938) - java mirror: a 'java/lang/Class' = 'java/util/stream/StreamSpliterators$IntWrappingS\ pliterator$$Lambda$168' - vtable length 14 (start addr: 0xe70231a0) - itable length 26 (start addr: 0xe70231d8) - ---- static fields (0 words): - ---- non-static fields (1 words): - private final 'arg$1' 'Ljava/util/function/IntConsumer;' @8 - non-static oop maps: 8-8 (gdb) print *((Klass*)0xe7023098) $15 = {<Metadata> = {<MetaspaceObj> = {<No data fields>}, _vptr.Metadata = 0xf71ba3a8, _valid = 0}, _layout_helper = 16, _super_check_offset = 32, _name = 0xe9b269a0, _secondary_super_cache = 0xe9d06b18, _secondary_supers = 0xe7023080, _primary_supers = {0xebfb5240, 0xe7023098, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, _java_mirror = {_o = 0xef5d2308}, _super = 0xebfb5240, _subklass = 0x0, _next_sibling = 0xe7022698, _next_link = 0x0, _class_loader_data = 0xe9b267a0, _modifier_flags = 4112, _access_flags = { _flags = 268439600}, _last_biased_lock_bulk_revocation_time = 0, _prototype_header = 0x1, _biased_lock_revocation_count = 0, _trace_id = 114556928, _modified_oops = 0 '\000', _accumulated_modified_oops = 0 '\000'} (gdb) print *(ClassLoaderData*)0xe9b267a0 $29 = {<CHeapObj<256u>> = {<AllocatedObj> = { _vptr.AllocatedObj = 0xf7260d80}, <No data fields>}, static _the_null_class_loader_data = 0xf6618e28, _class_loader = {_o = 0x0}, _dependencies = {_list_head = {<oop> = { _o = 0xef5d22f0}, <No data fields>}}, _metaspace = 0xe9b261a8, _metaspace_lock = 0xe9b26800, _unloading = true, _keep_alive = false, _is_anonymous = true, _claimed = 0, _klasses = 0xe7023098, _handles = 0x0, _jmethod_ids = 0x0, _deallocate_list = 0x0, _next = 0xe98018e0, static _ro_metaspace = 0x0, static _rw_metaspace = 0x0} #### Mirror class (oop = 0xef5d2308) #### (gdb) print *(oopDesc*)0xef5d2308 $20 = {_mark = 0x8bc9e109, _metadata = {_klass = 0xebfc4538, _compressed_klass = 3959178552}, static _bs = 0xf6614568} (gdb) print *(Klass*)0xebfc4538 $22 = {<Metadata> = {<MetaspaceObj> = {<No data fields>}, _vptr.Metadata = 0xf71ba6e8, _valid = 0}, _layout_helper = 81, _super_check_offset = 32, _name = 0xf44420e0, _secondary_super_cache = 0xebfbe4d0, _secondary_supers = 0xebfc4520, _primary_supers = {0xebfb5240, 0xebfc4538, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, _java_mirror = {_o = 0xeef29438}, _super = 0xebfb5240, _subklass = 0x0, _next_sibling = 0xebfbe4d0, _next_link = 0xebfbe4d0, _class_loader_data = 0xf6618e28, _modifier_flags = 17, _access_flags = { _flags = 538968113}, _last_biased_lock_bulk_revocation_time = 0, _prototype_header = 0x5, _biased_lock_revocation_count = 1, _trace_id = 1114112, _modified_oops = 0 '\000', _accumulated_modified_oops = 0 '\000'} (gdb) print *(ClassLoaderData*)0xf6618e28 $28 = {<CHeapObj<256u>> = {<AllocatedObj> = { _vptr.AllocatedObj = 0xf7260d80}, <No data fields>}, static _the_null_class_loader_data = 0xf6618e28, _class_loader = {_o = 0x0}, _dependencies = {_list_head = {<oop> = { _o = 0xeef0fb88}, <No data fields>}}, _metaspace = 0xf6631070, _metaspace_lock = 0xf6618e88, _unloading = false, _keep_alive = false, _is_anonymous = false, _claimed = 1, _klasses = 0xe7012828, _handles = 0xf6666ef8, _jmethod_ids = 0xf66a2c50, _deallocate_list = 0xf6657858, _next = 0x0, static _ro_metaspace = 0x0, static _rw_metaspace = 0x0}
11-08-2014

A compiled IC in the C1 compiled method 'java.util.stream.Streams$RangeIntSpliterator::forEachRemaining' references the Klass 'java.util.stream.StreamSpliterators$IntWrappingSpliterator$$Lambda$170/25231275' that belongs to the unloaded mirror klass 'java/util/stream/StreamSpliterators$IntWrappingSpliterator$$Lambda$170'. The problem is that the IC is not cleaned because 'SystemDictionary::do_unloading' in 'GenMarkSweep::mark_sweep_phase1' returned false, i.e no class was unloaded by GC. How is it possible then, that the mirror class is unloaded?
11-08-2014