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

CDS dynamic dump asserts with JFR RecordingStream

XMLWordPrintable

    • b27

        Use the attached JFRDynamicCDS.java test case:

        $ rm -rf JFRDynamicCDS.tmp
        $ mkdir -p JFRDynamicCDS.tmp
        $ javac -d JFRDynamicCDS.tmp JFRDynamicCDS.java
        $ jar cvf JFRDynamicCDS.jar -C JFRDynamicCDS.tmp .

        $ java -cp JFRDynamicCDS.jar -Xlog:cds -XX:ArchiveClassesAtExit=JFRDynamicCDS.jsa JFRDynamicCDS
        ==> CRASH

        $ java -cp JFRDynamicCDS.jar -Xlog:cds -XX:ArchiveClassesAtExit=JFRDynamicCDS.jsa JFRDynamicCDS 0
        ==> no crash

        $ java -cp JFRDynamicCDS.jar -Xlog:cds -XX:ArchiveClassesAtExit=JFRDynamicCDS.jsa JFRDynamicCDS 1
        ==> CRASH

        So -XX:ArchiveClassesAtExit would crash if the app simply does:
             RecordingStream rs = new RecordingStream();
             rs.close();

        This crash is observable only with JDK 17. JDK 16 is OK.

        ===============================================================

        # Internal Error (/jdk2/gil/open/src/hotspot/share/cds/archiveBuilder.cpp:841), pid=27195, tid=27204
        # assert(_builder->is_in_mapped_static_archive(*p)) failed: old pointer must point inside buffer space or mapped static archive

        Current thread (0x00007f70e8279780): VMThread "VM Thread" [stack: 0x00007f70b75f7000,0x00007f70b76f7000] [id=27204]

        Stack: [0x00007f70b75f7000,0x00007f70b76f7000], sp=0x00007f70b76f58f0, free space=1018k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x5c11f0] ArchiveBuilder::relocate_to_requested()+0x260
        V [libjvm.so+0xb7aece] VM_PopulateDynamicDumpSharedSpace::doit()+0x2fe
        V [libjvm.so+0x199613a] VM_Operation::evaluate()+0x18a
        V [libjvm.so+0x19b9473] VMThread::evaluate_operation(VM_Operation*)+0x183
        V [libjvm.so+0x19ba0e8] VMThread::inner_execute(VM_Operation*)+0x1f8
        V [libjvm.so+0x19ba325] VMThread::loop()+0xb5
        V [libjvm.so+0x19ba457] VMThread::run()+0xc7
        V [libjvm.so+0x18ac120] Thread::call_run()+0x100
        V [libjvm.so+0x1577e0e] thread_native_entry(Thread*)+0x10e

              ccheung Calvin Cheung
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: