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

runtime/cds/appcds/aotCache/OldClassSupport.java assert(can_add()) failed: Cannot add TrainingData objects

XMLWordPrintable

    • aarch64
    • os_x

      The following test failed in the JDK26 CI:

      runtime/cds/appcds/aotCache/OldClassSupport.java

      Here's a snippet from the log file:

      #section:driver
      ----------messages:(8/242)----------
      command: driver OldClassSupport
      reason: User specified action: run driver OldClassSupport
      started: Thu Sep 25 09:28:30 GMT 2025
      Mode: agentvm
      Agent id: 8
      Process id: 44075
      finished: Thu Sep 25 09:28:37 GMT 2025
      elapsed time (seconds): 7.047
      ----------configuration:(18/3143)----------

      <snip>

      ----------System.out:(9/4547)----------
      Command line: [/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-26+17-1766/macosx-aarch64-debug.jdk/jdk-26/fastdebug/bin/java -cp /System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/classes/1/runtime/cds/appcds/aotCache/OldClassSupport.d:/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-26+17-1766/src.full/open/test/hotspot/jtreg/runtime/cds/appcds/aotCache:/System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/classes/1/runtime/cds/appcds/aotCache/OldClassSupport.d/test/jdk/lib/testlibrary:/System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/classes/1/runtime/cds/appcds/aotCache/OldClassSupport.d/test/lib:/System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/classes/1/runtime/cds/appcds/aotCache/OldClassSupport.d/test/hotspot/jtreg/runtime/cds/appcds/test-classes:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/8/2/bundles/jtreg-8+2.zip/jtreg/lib/jtreg.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/8/2/bundles/jtreg-8+2.zip/jtreg/lib/junit-platform-console-standalone-1.13.3.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/8/2/bundles/jtreg-8+2.zip/jtreg/lib/testng-7.3.0.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/8/2/bundles/jtreg-8+2.zip/jtreg/lib/jcommander-1.82.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/8/2/bundles/jtreg-8+2.zip/jtreg/lib/guice-5.1.0.jar -XX:MaxRAMPercentage=6.25 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/24/36/bundles/macos-aarch64/jdk-24_macos-aarch64_bin.tar.gz/jdk-24.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/tmp -Xlog:aot+class=debug -Xlog:aot+resolve=trace -XX:AOTMode=record -XX:AOTConfiguration=AppUsesOldClass.aotconfig -Xlog:arguments,class+load=debug,aot=debug,cds=debug,aot+class=debug:file=AppUsesOldClass.aotconfig.log::filesize=0 -cp /System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/scratch/2/app.jar -Xlog:cds+class=debug AppUsesOldClass ]
      [2025-09-25T09:28:30.507482Z] Gathering output for process 44099
      [ELAPSED: 6907 ms]
      [logging stdout to /System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/scratch/2/runtime.cds.appcds.aotCache.OldClassSupport.java-0000-TRAINING.stdout]
      [logging stderr to /System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1601/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/83552b22-2d9a-4acb-8640-848f9153f782/runs/daf1637e-591f-41e8-9f98-25c33b45d825/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_tier2_runtime/scratch/2/runtime.cds.appcds.aotCache.OldClassSupport.java-0000-TRAINING.stderr]
      [STDERR]

      [2025-09-25T09:28:37.413788Z] Waiting for completion for process 44099
      [2025-09-25T09:28:37.413890Z] Waiting for completion finished for process 44099
      ----------System.err:(15/878)----------
      java.lang.RuntimeException: Hotspot crashed
      at jdk.test.lib.cds.CDSTestUtils.executeAndLog(CDSTestUtils.java:699)
      at jdk.test.lib.cds.CDSAppTester.executeAndCheck(CDSAppTester.java:212)
      at jdk.test.lib.cds.CDSAppTester.recordAOTConfiguration(CDSAppTester.java:268)
      at jdk.test.lib.cds.CDSAppTester.runAOTWorkflow(CDSAppTester.java:496)
      at jdk.test.lib.cds.CDSAppTester.run(CDSAppTester.java:447)
      at OldClassSupport.main(OldClassSupport.java:52)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.base/java.lang.reflect.Method.invoke(Method.java:565)
      at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
      at java.base/java.lang.Thread.run(Thread.java:1474)

      JavaTest Message: Test threw exception: java.lang.RuntimeException
      JavaTest Message: shutting down test

      result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Hotspot crashed


      Here are snippets from the hs_err_pid file:

      # Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/0103b69c-746c-4fb5-bf13-94918f380124-S1654/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c392cbe-1477-4291-8b10-83fc526951ab/runs/4dadf53d-0a4f-4fdd-aa60-ffba3deb1249/workspace/open/src/hotspot/share/oops/trainingData.hpp:162), pid=44099, tid=26115
      # assert(can_add()) failed: Cannot add TrainingData objects
      #
      # JRE version: Java(TM) SE Runtime Environment (26.0+17) (fastdebug build 26-ea+17-1766)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-ea+17-1766, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
      # Core dump will be written. Default location: core.44099

      <snip>

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

      Current thread (0x000000010f80b410): JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=26115, stack(0x000000016f884000,0x000000016fa87000) (2060K)]


      Current CompileTask:
      C1:742 264 1 java.lang.classfile.Opcode::kind (5 bytes)

      Stack: [0x000000016f884000,0x000000016fa87000], sp=0x000000016fa85fa0, free space=2055k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x123a888] VMError::report(outputStream*, bool)+0x1b68 (trainingData.hpp:162)
      V [libjvm.dylib+0x123e184] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x55c
      V [libjvm.dylib+0x5b8628] print_error_for_unit_test(char const*, char const*, char*)+0x0
      V [libjvm.dylib+0x119b988] TrainingData::DepList<CompileTrainingData*>::append_if_missing(CompileTrainingData*)+0x1d4
      V [libjvm.dylib+0x1197fa4] CompileTrainingData::add_init_dep(KlassTrainingData*)+0x3c
      V [libjvm.dylib+0x1197eac] CompileTrainingData::notice_jit_observation(ciEnv*, ciBaseObject*)+0x184
      V [libjvm.dylib+0x45ed20] ciObjectFactory::get_metadata(Metadata*)+0x44c
      V [libjvm.dylib+0x425c54] ciEnv::get_klass_by_name_impl(ciKlass*, constantPoolHandle const&, ciSymbol*, bool)+0x394
      V [libjvm.dylib+0x46cd34] ciSignature::ciSignature(ciKlass*, constantPoolHandle const&, ciSymbol*)+0x270
      V [libjvm.dylib+0x43eb84] ciMethod::ciMethod(methodHandle const&, ciInstanceKlass*)+0x534
      V [libjvm.dylib+0x460710] ciObjectFactory::create_new_metadata(Metadata*)+0x2dc
      V [libjvm.dylib+0x45eb24] ciObjectFactory::get_metadata(Metadata*)+0x250
      V [libjvm.dylib+0x42549c] ciEnv::get_method_from_handle(Method*)+0xcc
      V [libjvm.dylib+0x529d64] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x440
      V [libjvm.dylib+0x5295b0] CompileBroker::compiler_thread_loop()+0x3cc
      V [libjvm.dylib+0x91f810] JavaThread::thread_main_inner()+0x1d0
      V [libjvm.dylib+0x117a2bc] Thread::call_run()+0xf0
      V [libjvm.dylib+0xed7c04] thread_native_entry(Thread*)+0x138
      C [libsystem_pthread.dylib+0x6bc8] _pthread_start+0x88
      Lock stack of current Java thread (top to bottom):

      I'm starting this bug off in hotspot/compiler for initial triage.

            iveresov Igor Veresov
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: