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

C2: assert(no_dead_loop) failed: dead loop detected - irreducible loops are broken

XMLWordPrintable

      My jasm fuzzer found a dead-loop.

      Attached you can find the full fuzzer test X.jasm as well as a reduced version X3.jasm.

      Since the error is a bit intermittent, we require:
      -XX:RepeatCompilation=1000 -XX:+StressIGVN

      java -jar ~/Documents/asmtools-7.0-build/release/lib/asmtools.jar jasm X.jasm
      java -XX:+UnlockExperimentalVMOptions -Xcomp -XX:CompileCommand=compileonly,X::test* -XX:-TieredCompilation -XX:RepeatCompilation=1000 -XX:+StressIGVN X


      java -jar ~/Documents/asmtools-7.0-build/release/lib/asmtools.jar jasm X3.jasm
      java -XX:+UnlockExperimentalVMOptions -Xcomp -XX:CompileCommand=compileonly,X3::test* -XX:-TieredCompilation -XX:RepeatCompilation=1000 -XX:+StressIGVN X3

      Result is this:
      dist dump
      ---------------------------------------------
         2 0 Root === 0 2 3 4 33 34 1 1 20 1 32 [[ 0 1 256 338 125 222 104 388 393 395 510 138 331 689 129 111 169 109 170 442 443 115 214 726 155 208 199 352 495 157 463 576 246 110 131 132 136 851 855 1148 ]]
         1 1 Con === 0 [[ ]] #top
         0 149 OrI === _ 149 1 [[ 149 40 51 52 218 47 761 ]] !orig=181,[2909] !jvms: X::test @ bci:2727
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/.../src/hotspot/share/opto/phaseX.cpp:956), pid=4189197, tid=4189210
      # assert(no_dead_loop) failed: dead loop detected

      Current CompileTask:
      C2: 107 6 4 X::test (3794 bytes)

      Stack: [0x00007f3061264000,0x00007f3061365000], sp=0x00007f306135f630, free space=1005k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x177ac78] PhaseGVN::dead_loop_check(Node*) [clone .part.0]+0x158 (phaseX.cpp:943)
      V [libjvm.so+0x17897e9] PhaseIterGVN::transform_old(Node*)+0x4e9
      V [libjvm.so+0x17817ee] PhaseIterGVN::optimize()+0x6e
      V [libjvm.so+0xaef32a] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x6aa
      V [libjvm.so+0xae8640] Compile::Optimize()+0x4c0
      V [libjvm.so+0xaed10e] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x18ce
      V [libjvm.so+0x8fec67] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4e7
      V [libjvm.so+0xafa22c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa7c
      V [libjvm.so+0xafafe8] CompileBroker::compiler_thread_loop()+0x5d8
      V [libjvm.so+0x1067896] JavaThread::thread_main_inner()+0x206
      V [libjvm.so+0x1a6a8b0] Thread::call_run()+0x100
      V [libjvm.so+0x16ff053] thread_native_entry(Thread*)+0x103


      Different failure mode with JDK 8u and 17u:

      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (.../hotspot/src/share/vm/opto/loopnode.cpp:3133), pid=3446922, tid=0x00007f058a92a700
      # assert(!in->is_CFG()) failed: CFG Node with no controlling input?

      V [libjvm.so+0x119823d] VMError::report_and_die()+0x2fd
      V [libjvm.so+0x793e11] report_vm_error(char const*, int, char const*, char const*)+0x61
      V [libjvm.so+0xd10227] PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x587
      V [libjvm.so+0xd16ef3] PhaseIdealLoop::build_and_optimize(bool, bool)+0x7e3
      V [libjvm.so+0x6f7ba3] Compile::Optimize()+0x453
      V [libjvm.so+0x6f9375] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool)+0xe05
      V [libjvm.so+0x58db18] C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0xe8
      V [libjvm.so+0x708442] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x942
      V [libjvm.so+0x709a28] CompileBroker::compiler_thread_loop()+0x858
      V [libjvm.so+0x1109b28] JavaThread::thread_main_inner()+0x198
      V [libjvm.so+0x1109e30] JavaThread::run()+0x2c0
      V [libjvm.so+0xea1902] java_start(Thread*)+0x102
      C [libpthread.so.0+0x8609] start_thread+0xd9

        1. X4.jasm
          1 kB
        2. X4_03.png
          X4_03.png
          11 kB
        3. X4_02.png
          X4_02.png
          62 kB
        4. X4_01.png
          X4_01.png
          71 kB
        5. X4_00.png
          X4_00.png
          74 kB
        6. X3.jasm
          2 kB
        7. X3.class
          0.5 kB
        8. X.jasm
          41 kB
        9. X.class
          5 kB

            Unassigned Unassigned
            epeter Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: