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

C2: assert(!loop->_body.contains(in)) failed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 25
    • 24, 25
    • hotspot

      The attached test T.java fails with the following assertion after JDK-8343394 which must have revealed an existing issue (i.e. most likely not a recent regression). I'm therefore targeting this to JDK 25 for now.

      To reproduce:
      $ java -Xbatch T.java
      $ java -Xbatch -XX:CompileOnly=T::test T.java

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/8862186e-67f1-442a-b654-15b802343ea2-S71/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/918089c0-bef2-4520-88c7-8241c86af96b/runs/7bc6b11b-fce2-4009-ad40-77fde1b925fd/workspace/open/src/hotspot/share/opto/loopnode.cpp:3196), pid=57888, tid=57902
      # Error: assert(!loop->_body.contains(in)) failed
      #
      # JRE version: Java(TM) SE Runtime Environment (24.0+25) (fastdebug build 24-ea+25-3042)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-ea+25-3042, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x132c8b4] OuterStripMinedLoopNode::transform_to_counted_loop(PhaseIterGVN*, PhaseIdealLoop*)+0x974

      ..........
      Command Line: -Xbatch -XX:CompileOnly=T::test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher T.java
      ..........
      C2:1258 109 b 4 T::test (48 bytes)

      Stack: [0x0000759aa80f1000,0x0000759aa81f1000], sp=0x0000759aa81ebb30, free space=1002k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x132c8b4] OuterStripMinedLoopNode::transform_to_counted_loop(PhaseIterGVN*, PhaseIdealLoop*)+0x974 (loopnode.cpp:3196)
      V [libjvm.so+0x1338828] PhaseIdealLoop::create_loop_nest(IdealLoopTree*, Node_List&)+0x4f8
      V [libjvm.so+0x1316ae8] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x498
      V [libjvm.so+0x1316dce] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x17e
      V [libjvm.so+0x1316c85] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x35
      V [libjvm.so+0x1316c85] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x35
      V [libjvm.so+0x134338b] PhaseIdealLoop::build_and_optimize()+0xfab
      V [libjvm.so+0xa56da8] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3a8
      V [libjvm.so+0xa4fe6c] Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0x5c
      V [libjvm.so+0xa50bd1] Compile::Optimize()+0xa91
      V [libjvm.so+0xa54aff] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b5f
      V [libjvm.so+0x89e315] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1d5
      V [libjvm.so+0xa60c08] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928
      V [libjvm.so+0xa61948] CompileBroker::compiler_thread_loop()+0x528
      V [libjvm.so+0xf35dbe] JavaThread::thread_main_inner()+0xee
      V [libjvm.so+0x187d4c6] Thread::call_run()+0xb6
      V [libjvm.so+0x1558498] thread_native_entry(Thread*)+0x128


      This bug was reported externally over the hotspot-compiler-dev mailing list by Matthias Ernst <matthias@mernst.org>:
      https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2024-December/083722.html

            roland Roland Westrelin
            chagedorn Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: