Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8267954

Shared classes that failed to load should not be loaded again

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 17
    • 17
    • hotspot
    • b26
    • x86_64
    • linux

    Description

      The following test failed in the JDK17 CI:

      runtime/cds/appcds/dynamicArchive/TestDynamicDumpAtOom.java

      Here's a snippet from the log file:

      ----------System.err:(60/4659)----------
       stdout: [[0.028s][info][cds] trying to map /opt/mach5/mesos/work_dir/jib-master/install/jdk-17+25-2190/linux-x64-debug.jdk/jdk-17/fastdebug/lib/server/classes_nocoops.jsa
      [0.028s][info][cds] Opened archive /opt/mach5/mesos/work_dir/jib-master/install/jdk-17+25-2190/linux-x64-debug.jdk/jdk-17/fastdebug/lib/server/classes_nocoops.jsa.
      [0.028s][info][cds] Archive was created with UseCompressedOops = 0, UseCompressedClassPointers = 1
      [0.028s][info][cds] full module graph: disabled because archive was created without full module graph
      [0.028s][info][cds] Core region alignment: 4096
      [0.028s][info][cds] Reserved archive_space_rs [0x0000000800000000 - 0x0000000801000000] (16777216) bytes
      [0.028s][info][cds] Reserved class_space_rs [0x0000000801000000 - 0x0000000841000000] (1073741824) bytes
      [0.028s][info][cds] Mapped static region #0 at base 0x0000000800000000 top 0x0000000800482000 (ReadWrite)
      [0.028s][info][cds] Mapped static region #1 at base 0x0000000800482000 top 0x0000000800c01000 (ReadOnly)
      [0.028s][info][cds] optimized module handling: enabled
      [0.028s][info][cds] full module graph: disabled
      [4.560s][info][cds] Regenerate MethodHandle Holder classes...
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/systemDictionary.cpp:1155
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S79212/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/7cf2911c-3920-446c-838e-2cc03feaaebf/runs/e9e89a5c-26dd-476a-9edf-c39c30ba55db/workspace/open/src/hotspot/share/classfile/systemDictionary.cpp:1155), pid=9363, tid=9364
      # assert(!ik->is_unshareable_info_restored()) failed: shared class can be loaded only once
      #
      # JRE version: Java(TM) SE Runtime Environment (17.0+25) (fastdebug build 17-ea+25-LTS-2190)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+25-LTS-2190, compiled mode, sharing, compressed class ptrs, serial gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x1845659] SystemDictionary::load_shared_class(InstanceKlass*, Handle, Handle, ClassFileStream const*, PackageEntry*, JavaThread*)+0x79
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S79029/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/587bbf04-d0b4-418e-9110-127721ce4043/runs/4821e22d-bce4-4532-8dcd-db4b247e46f5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_runtime/scratch/1/core.9363)
      #
      # An error report file with more information is saved as:
      # /opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S79029/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/587bbf04-d0b4-418e-9110-127721ce4043/runs/4821e22d-bce4-4532-8dcd-db4b247e46f5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_runtime/scratch/1/hs_err_pid9363.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #
      ];
       stderr: [Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
      at MiniStoreOom.main(MiniStoreOom.java:31)
      ]
       exitValue = 134


      Here's the crashing thread's stack:

      --------------- T H R E A D ---------------

      Current thread (0x00007f021c027360): JavaThread "DestroyJavaVM" [_thread_in_vm, id=9364, stack(0x00007f0226e10000,0x00007f0226f11000)]

      Stack: [0x00007f0226e10000,0x00007f0226f11000], sp=0x00007f0226f0ef40, free space=1019k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1845659] SystemDictionary::load_shared_class(InstanceKlass*, Handle, Handle, ClassFileStream const*, PackageEntry*, JavaThread*)+0x79
      V [libjvm.so+0x1845f54] SystemDictionary::load_instance_class_impl(Symbol*, Handle, JavaThread*)+0x4e4
      V [libjvm.so+0x1843fa8] SystemDictionary::load_instance_class(unsigned int, Symbol*, Handle, JavaThread*)+0x28
      V [libjvm.so+0x184485d] SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, JavaThread*)+0x77d
      V [libjvm.so+0x18465ea] SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, JavaThread*)+0x2a
      V [libjvm.so+0xa67c83] ConstantPool::klass_at_impl(constantPoolHandle const&, int, JavaThread*)+0x1d3
      V [libjvm.so+0xe5fefc] InterpreterRuntime::_new(JavaThread*, ConstantPool*, int)+0x8c
      j java.util.ArrayList.subList(II)Ljava/util/List;+9 java.base@17-ea
      j java.lang.String.split(Ljava/lang/String;I)[Ljava/lang/String;+303 java.base@17-ea
      J 1476 c2 jdk.internal.misc.CDS.validateInputLines([Ljava/lang/String;)V java.base@17-ea (247 bytes) @ 0x00007f0220e1afe4 [0x00007f0220e1af20+0x00000000000000c4]
      J 1475 c2 jdk.internal.misc.CDS.generateLambdaFormHolderClasses([Ljava/lang/String;)[Ljava/lang/Object; java.base@17-ea (113 bytes) @ 0x00007f0220e17c1c [0x00007f0220e17c00+0x000000000000001c]
      v ~StubRoutines::call_stub
      V [libjvm.so+0xe73404] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x504
      V [libjvm.so+0xe7459b] JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x31b
      V [libjvm.so+0xe7498b] JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, Handle, JavaThread*)+0x6b
      V [libjvm.so+0x12333fa] LambdaFormInvokers::regenerate_holder_classes(JavaThread*)+0x5aa
      V [libjvm.so+0x145a56d] MetaspaceShared::link_and_cleanup_shared_classes(JavaThread*)+0xdd
      V [libjvm.so+0xb7aa56] DynamicArchive::prepare_for_dynamic_dumping_at_exit()+0xd6
      V [libjvm.so+0x18ab1dd] JavaThread::invoke_shutdown_hooks()+0xbd
      V [libjvm.so+0x18b2a86] Threads::destroy_vm()+0x116
      V [libjvm.so+0xf7f6a4] jni_DestroyJavaVM+0x1d4
      C [libjli.so+0x3d62] JavaMain+0x2c2
      C [libjli.so+0x7ce9] ThreadJavaMain+0x9

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j java.util.ArrayList.subList(II)Ljava/util/List;+9 java.base@17-ea
      j java.lang.String.split(Ljava/lang/String;I)[Ljava/lang/String;+303 java.base@17-ea
      J 1476 c2 jdk.internal.misc.CDS.validateInputLines([Ljava/lang/String;)V java.base@17-ea (247 bytes) @ 0x00007f0220e1afe4 [0x00007f0220e1af20+0x00000000000000c4]
      J 1475 c2 jdk.internal.misc.CDS.generateLambdaFormHolderClasses([Ljava/lang/String;)[Ljava/lang/Object; java.base@17-ea (113 bytes) @ 0x00007f0220e17c1c [0x00007f0220e17c00+0x000000000000001c]
      v ~StubRoutines::call_stub


      The following bug tracked the same assertion failure in Loom:

          JDK-8242065 [loom] assert(!ik->is_unshareable_info_restored()) failed: shared class can be loaded only once

      Attachments

        Issue Links

          Activity

            People

              minqi Yumin Qi
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: