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

crash on exit when using AppCDS with aspectj javaagent

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      java version "21.0.2" 2024-01-16 LTS
      Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
      Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

      any OS

      A DESCRIPTION OF THE PROBLEM :
      I was trying to use AppCDS with aspectj javaagent, but the jvm crash when dynamic dumping on exit


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.write a main method as the following
      ---
      import java.lang.management.GarbageCollectorMXBean;
      import java.lang.management.ManagementFactory;
      import java.util.List;

      public class Demo {
      public static void main(String[] args) throws Throwable {
      List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
      }
      }
      ---
      2.run it with aspectjweaver agent
      ---
      java -XX:+UnlockDiagnosticVMOptions -XX:+AllowArchivingWithJavaAgent -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=demo.jsa -javaagent:aspectjweaver-1.9.5.jar -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true -cp AppCdsDemo-1.0-SNAPSHOT.jar com.vip.demo.Demo
      ---

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      demo.jsa is generated successully
      ACTUAL -
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (systemDictionaryShared.cpp:574), pid=2930, tid=2938
      # guarantee(!k->is_shared_unregistered_class()) failed: Class loader type must be set for BUILTIN class java/lang/invoke/BoundMethodHandle$Species_LLLLL
      #
      # JRE version: Java(TM) SE Runtime Environment (21.0.2+13) (build 21.0.2+13-LTS-58)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.2+13-LTS-58, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xe60a3a] SystemDictionaryShared::validate_before_archiving(InstanceKlass*)+0x21a
      #
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      # /tmp/AppCdsDemo3/AppCdsDemo-1.0-SNAPSHOT/hs_err_pid2930.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #


      ---------- BEGIN SOURCE ----------
      package com.vip.demo;


      import java.lang.management.GarbageCollectorMXBean;
      import java.lang.management.ManagementFactory;
      import java.util.List;

      public class Demo {
      public static void main(String[] args) throws Throwable {
      List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
      }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


            ccheung Calvin Cheung
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: