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

CDS should not relocate heap if mapping fails

XMLWordPrintable

    • b11
    • generic
    • generic
    • Verified

      The following test failed in the JDK21 CI:

      runtime/cds/appcds/SharedArchiveConsistency.java

      Here's a log file snippet from the linux-x64-debug sighting:

      [0.091s][info][cds] CDS heap data relocation delta = 0 bytes
      [0.091s][info][cds] Trying to map heap data: region[3] at 0x00000000fff00000, size = 532664 bytes
      [0.093s][info][cds] Trying to map heap data: region[5] at 0x00000000ffe00000, size = 495368 bytes
      [0.094s][info][cds] Checksum verification failed.
      [0.094s][info][cds] UseSharedSpaces: mapped heap regions are corrupt
      [0.094s][info][cds] optimized module handling: enabled
      [0.094s][info][cds] full module graph: disabled
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007fd53006d6fb, pid=442834, tid=442838
      #
      # JRE version: (21.0+11) (fastdebug build )
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+11-LTS-812, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x66e6fb] ArchiveHeapLoader::patch_native_pointers() [clone .part.0]+0x1bb
      #
      # 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/91e16c40-06d4-468a-9fc3-7198a5bb7d5a-S119895/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ca30f168-4228-4faa-bf40-e6ef16ffa29a/runs/13c13fa6-3c87-4d55-b51b-00816b28aeb5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_cds_relocation/scratch/1/core.442834)
      #
      # An error report file with more information is saved as:
      # /opt/mach5/mesos/work_dir/slaves/91e16c40-06d4-468a-9fc3-7198a5bb7d5a-S119895/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ca30f168-4228-4faa-bf40-e6ef16ffa29a/runs/13c13fa6-3c87-4d55-b51b-00816b28aeb5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_cds_relocation/scratch/1/hs_err_pid442834.log
      #
      #
      ];
       stderr: []
       exitValue = 134

      java.lang.RuntimeException: 'A fatal error has been detected by the Java Runtime Environment' found in stdout
      at jdk.test.lib.process.OutputAnalyzer.shouldNotContain(OutputAnalyzer.java:267)
      at SharedArchiveConsistency.testAndCheck(SharedArchiveConsistency.java:88)
      at SharedArchiveConsistency.main(SharedArchiveConsistency.java:222)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      at java.base/java.lang.reflect.Method.invoke(Method.java:578)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
      at java.base/java.lang.Thread.run(Thread.java:1623)

      JavaTest Message: Test threw exception: java.lang.RuntimeException: 'A fatal error has been detected by the Java Runtime Environment' found in stdout
      JavaTest Message: shutting down test

      STATUS:Failed.`main' threw exception: java.lang.RuntimeException: 'A fatal error has been detected by the Java Runtime Environment' found in stdout
      ----------rerun:(40/7483)*----------


      Here's the crashing thread's stack:

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

      Current thread (0x00007fd52803e390): JavaThread "Unknown thread" [_thread_in_vm, id=442838, stack(0x00007fd53283d000,0x00007fd53293e000)]

      Stack: [0x00007fd53283d000,0x00007fd53293e000], sp=0x00007fd53293ca70, free space=1022k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x66e6fb] ArchiveHeapLoader::patch_native_pointers() [clone .part.0]+0x1bb (archiveHeapLoader.cpp:526)
      V [libjvm.so+0x16129c0] MetaspaceShared::initialize_shared_spaces()+0x80 (metaspaceShared.cpp:1434)
      V [libjvm.so+0x1aed321] universe_init()+0x1f1 (universe.cpp:819)
      V [libjvm.so+0xffa5c7] init_globals()+0x37 (init.cpp:123)
      V [libjvm.so+0x1ab5fdf] Threads::create_vm(JavaVMInitArgs*, bool*)+0x37f (threads.cpp:568)
      V [libjvm.so+0x11abb68] JNI_CreateJavaVM+0x98 (jni.cpp:3588)
      C [libjli.so+0x3b0f] JavaMain+0x8f (java.c:1459)
      C [libjli.so+0x7a29] ThreadJavaMain+0x9 (java_md.c:650)

      siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x00000000ffe00018

            iklam Ioi Lam
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: