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

C2: assert(x_ctrl == get_late_ctrl_with_anti_dep(x->as_Load(), early_ctrl, x_ctrl)) failed: anti-dependences were already checked

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 25
    • 17, 21, 22, 23, 24
    • hotspot

      A quick mention in the PR would be appreciated, I spent quite some time extracting and cleaning the JASM so that it also reproduces on older JDK. Though it can probably be further reduced - and maybe even a JAVA file constructed.

      Affected: JDK23, 22, 21, 17 (could not reproduce with JDK11 - not sure why, please check again once you understand the bug)

      Hard to say what is wrong exactly, but could be a normal loop-opts bug. Wrong anti-dependence indicates that this may lead to wrong results.

      emanuel@emanuel-oracle:xyz$ java -jar ~/Documents/asmtools-7.0-build/release/lib/asmtools.jar jasm X.jasm
      emanuel@emanuel-oracle:xyz$ /oracle-work/jdk-fork2/build/linux-x64-debug/jdk/bin/java -XX:CompileCommand=printcompilation,X::* -XX:CompileCommand=compileonly,X::test -Xcomp -XX:-TieredCompilation X
      CompileCommand: PrintCompilation X.* bool PrintCompilation = true
      CompileCommand: compileonly X.test bool compileonly = true
      489 26 b X::test (189 bytes)
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/oracle-work/jdk-fork2/open/src/hotspot/share/opto/loopopts.cpp:1756), pid=3740705, tid=3740719
      # assert(x_ctrl == get_late_ctrl_with_anti_dep(x->as_Load(), early_ctrl, x_ctrl)) failed: anti-dependences were already checked
      #
      # JRE version: Java(TM) SE Runtime Environment (24.0) (fastdebug build 24-internal-2024-06-13-1913126.emanuel...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-internal-2024-06-13-1913126.emanuel..., compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x129dfb0] PhaseIdealLoop::try_sink_out_of_loop(Node*)+0xcd0
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /oracle-work/xyz/core.3740705)
      #
      # An error report file with more information is saved as:
      # /oracle-work/xyz/hs_err_pid3740705.log
      #
      # Compiler replay data is saved as:
      # /oracle-work/xyz/replay_pid3740705.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      Current CompileTask:
      C2:516 26 b X::test (189 bytes)

      Stack: [0x00007f38ed83a000,0x00007f38ed93b000], sp=0x00007f38ed935d10, free space=1007k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x129dfb0] PhaseIdealLoop::try_sink_out_of_loop(Node*)+0xcd0 (loopopts.cpp:1756)
      V [libjvm.so+0x129e093] PhaseIdealLoop::split_if_with_blocks_post(Node*)+0x83 (loopopts.cpp:1517)
      V [libjvm.so+0x129e956] PhaseIdealLoop::split_if_with_blocks(VectorSet&, Node_Stack&)+0x96 (loopopts.cpp:1950)
      V [libjvm.so+0x1290a89] PhaseIdealLoop::build_and_optimize()+0xee9 (loopnode.cpp:4815)
      V [libjvm.so+0x9de3a0] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x390 (loopnode.hpp:1115)
      V [libjvm.so+0x9d7005] Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0x75 (compile.cpp:2170)
      V [libjvm.so+0x9d97f1] Compile::Optimize()+0xe21 (compile.cpp:2417)
      V [libjvm.so+0x9dcf53] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b33 (compile.cpp:852)
      V [libjvm.so+0x832065] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1d5 (c2compiler.cpp:142)
      V [libjvm.so+0x9e8c08] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928 (compileBroker.cpp:2303)
      V [libjvm.so+0x9e9898] CompileBroker::compiler_thread_loop()+0x478 (compileBroker.cpp:1961)
      V [libjvm.so+0xe91e7c] JavaThread::thread_main_inner()+0xcc (javaThread.cpp:759)
      V [libjvm.so+0x17ab9b6] Thread::call_run()+0xb6 (thread.cpp:225)
      V [libjvm.so+0x1495ed7] thread_native_entry(Thread*)+0x127 (os_linux.cpp:849)

        1. hs_err_pid3740705.log
          74 kB
        2. replay_pid3740705.log
          153 kB
        3. X.class
          0.6 kB
        4. X.jasm
          2 kB

            thartmann Tobias Hartmann
            epeter Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: