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

split-if optimization causes empty loop to temporarily have more than one phi

    XMLWordPrintable

Details

    • b08
    • x86_64
    • linux

    Description

      The following test failed in the JDK20 CI:

      applications/javafuzzer/BigTest.java

      Here's a snippet from the log file:

      Summary of the JavaFuzzer run:
      ------------------------------
      Host: ol9-x64-653811
      Tests: 12 x 300
      Args: -conf config.yml

      Started at: Mon Dec 5 07:26:26 UTC 2022


      r7- 300: 183 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 117 Reference Java failures
      r5- 300: 178 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 122 Reference Java failures
      r1- 300: 184 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 116 Reference Java failures
      r11- 300: 175 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 125 Reference Java failures
      r10- 300: 170 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 130 Reference Java failures
      r8- 300: 194 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 106 Reference Java failures
      r6- 300: 174 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 126 Reference Java failures
      r12- 300: 181 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 119 Reference Java failures
      r2- 300: 172 passed, 0 crashes, 0 fails, 1 hangs, 0 incorrect tests, 127 Reference Java failures
      r9- 300: 180 passed, 2 crashes, 0 fails, 0 hangs, 0 incorrect tests, 119 Reference Java failures
      r4- 300: 186 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 114 Reference Java failures
      r3- 300: 179 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 121 Reference Java failures

      Finished at: Mon Dec 5 15:34:04 UTC 2022


      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S137551/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d38ec7f3-948d-490e-9c1f-f54015d7f963/runs/14cf096c-70f7-49b6-b667-8e738b11d2c0/workspace/open/src/hotspot/share/opto/loopTransform.cpp:3641), pid=2082216, tid=2082233
      # assert(iv == __null) failed: Too many phis
      #
      # JRE version: Java(TM) SE Runtime Environment (20.0+27) (fastdebug build 20-ea+27-2094)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+27-2094, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x148d3bc] IdealLoopTree::do_remove_empty_loop(PhaseIdealLoop*) [clone .part.0]+0x36c
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /tmp/fuzzer.tmp.ZMKvo9CUBY/core.2082216)
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S137551/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d38ec7f3-948d-490e-9c1f-f54015d7f963/runs/14cf096c-70f7-49b6-b667-8e738b11d2c0/workspace/open/src/hotspot/share/opto/loopTransform.cpp:3641), pid=2082457, tid=2082478
      # assert(iv == __null) failed: Too many phis
      #
      # JRE version: Java(TM) SE Runtime Environment (20.0+27) (fastdebug build 20-ea+27-2094)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+27-2094, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x148d3bc] IdealLoopTree::do_remove_empty_loop(PhaseIdealLoop*) [clone .part.0]+0x36c
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /tmp/fuzzer.tmp.ZMKvo9CUBY/core.2082457)
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      [2022-12-05T15:34:04.490226215Z] Waiting for completion for process 2036310
      [2022-12-05T15:34:04.490407488Z] Waiting for completion finished for process 2036310
      ----------System.err:(13/728)----------
      java.lang.RuntimeException: assertEquals: expected 1 to equal 2
      at jdk.test.lib.Asserts.fail(Asserts.java:594)
      at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
      at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
      at applications.javafuzzer.JavaFuzzerRunner.main(JavaFuzzerRunner.java:245)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.base/java.lang.reflect.Method.invoke(Method.java:578)
      at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
      at java.base/java.lang.Thread.run(Thread.java:1599)

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

      result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: assertEquals: expected 1 to equal 2


      Here's the crashing thread's stack:

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

      Current thread (0x00007f62c0341180): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=2082233, stack(0x00007f62a8cfe000,0x00007f62a8dfe000)]


      Current CompileTask:
      C2: 392 12 !b 4 Test::vMeth1 (259 bytes)

      Stack: [0x00007f62a8cfe000,0x00007f62a8dfe000], sp=0x00007f62a8df7f40, free space=999k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x148d3bc] IdealLoopTree::do_remove_empty_loop(PhaseIdealLoop*) [clone .part.0]+0x36c (loopTransform.cpp:3641)
      V [libjvm.so+0x1490fcf] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x6f (loopTransform.cpp:3616)
      V [libjvm.so+0x1491639] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x109 (loopTransform.cpp:3931)
      V [libjvm.so+0x14c0951] PhaseIdealLoop::build_and_optimize()+0xc61 (loopnode.cpp:4533)
      V [libjvm.so+0xb00b21] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x261 (loopnode.hpp:1082)
      V [libjvm.so+0xafc8b3] Compile::Optimize()+0xe13 (compile.cpp:2146)
      V [libjvm.so+0xafef6e] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x18ce (compile.cpp:830)
      V [libjvm.so+0x90f0a7] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4e7 (c2compiler.cpp:113)
      V [libjvm.so+0xb0be4c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa7c (compileBroker.cpp:2237)
      V [libjvm.so+0xb0cc38] CompileBroker::compiler_thread_loop()+0x608 (compileBroker.cpp:1916)
      V [libjvm.so+0x107d1b6] JavaThread::thread_main_inner()+0x206 (javaThread.cpp:697)
      V [libjvm.so+0x1a81520] Thread::call_run()+0x100 (thread.cpp:224)
      V [libjvm.so+0x1713773] thread_native_entry(Thread*)+0x103 (os_linux.cpp:739)

      Attachments

        1. cl-dead-phi.png
          cl-dead-phi.png
          171 kB
        2. FuzzerUtils.java
          13 kB
        3. Reduced.java
          0.4 kB
        4. Test.java
          7 kB

        Issue Links

          Activity

            People

              dfenacci Damon Fenacci
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: