AOTStreamedHeapLoader::get_root() crash when a root is null

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • repo-leyden
    • Affects Version/s: repo-leyden
    • Component/s: hotspot

      This was discovered when merging JDK-8365932 into the leyden-premain branch, where we can have a heap root whose value is null:

      https://github.com/openjdk/leyden/blob/b4058abd25e784106726da3504815d651e340af5/src/hotspot/share/cds/heapShared.cpp#L140

      static ArchivableStaticFieldInfo archive_subgraph_entry_fields[] = {
        [...]
        {"java/lang/reflect/Proxy$ProxyBuilder", "archivedData"}, // FIXME -- requires AOTClassLinking
       
      The root for Proxy$ProxyBuilder::archivedData is null when AOTClassLinking is disabled during AOT assembly phase.

      When running with such an AOT cache, the VM crashes:

      V [libjvm.so+0x73b698] AOTStreamedHeapLoader::heap_object_for_object_index(int)+0x28 (aotStreamedHeapLoader.cpp:128)
      V [libjvm.so+0x745eca] AOTStreamedHeapLoader::TracingObjectLoader::materialize_object(int, Stack<AOTHeapTraversalEntry, (MemTag)13>&, JavaThread*)+0x11a (aotStreamedHeapLoader.cpp:479)
      V [libjvm.so+0x74670b] AOTStreamedHeapLoader::TracingObjectLoader::materialize_object_transitive(int, Stack<AOTHeapTraversalEntry, (MemTag)13>&, JavaThread*)+0x14b (aotStreamedHeapLoader.cpp:512)
      V [libjvm.so+0x746984] AOTStreamedHeapLoader::TracingObjectLoader::materialize_root(int, Stack<AOTHeapTraversalEntry, (MemTag)13>&, JavaThread*)+0x44 (aotStreamedHeapLoader.cpp:524)
      V [libjvm.so+0x74b33c] AOTStreamedHeapLoader::materialize_root(int)+0x46c (aotStreamedHeapLoader.cpp:1060)
      V [libjvm.so+0x74b5ab] AOTStreamedHeapLoader::get_root(int)+0x11b (aotStreamedHeapLoader.cpp:1075)
      V [libjvm.so+0x1076faf] HeapShared::get_root(int, bool)+0x16f (heapShared.cpp:628)
      V [libjvm.so+0x107a35c] HeapShared::init_archived_fields_for(Klass*, ArchivedKlassSubGraphInfoRecord const*)+0x15c (heapShared.cpp:1768)
      V [libjvm.so+0x107adce] HeapShared::initialize_from_archived_subgraph(JavaThread*, Klass*)+0x9e (heapShared.cpp:1652)
      V [libjvm.so+0x1337524] JVM_InitializeFromArchive+0x2c4 (jvm.cpp:3365)
      j jdk.internal.misc.CDS.initializeFromArchive(Ljava/lang/Class;)V+0 java.base@26-internal
      j java.lang.reflect.Proxy$ProxyBuilder.<clinit>()V+82 java.base@26-internal

            Assignee:
            Unassigned
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: