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

C2 crash with assert(false) failed: Bad graph detected in build_loop_late

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10
      JRE version: Java(TM) SE Runtime Environment (8.0_231-b11) (build 1.8.0_231-b11)
      Java VM: Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode windows-amd64 compressed oops)

      A DESCRIPTION OF THE PROBLEM :
      I have what appears to be a bug with JIT compilation, the JVM will encounter a fatal EXCEPTION_ACCESS_VIOLATION after a number of iterations of the loop (I assume when JIT kicks in). I attached the offending code in the test case section.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd957f7082, pid=10256, tid=3960
      #
      # JRE version: Java(TM) SE Runtime Environment (13.0.1+9) (build 13.0.1+9)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (13.0.1+9, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
      # Problematic frame:
      # V [jvm.dll+0x547082]
      #
      # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
      #
      # An error report file with more information is saved as:
      # C:\Users\craig\IdeaProjects\repro\hs_err_pid10256.log
      [thread 12852 also had an error]
      #
      # Compiler replay data is saved as:
      # C:\Users\craig\IdeaProjects\repro\replay_pid10256.log
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd957f7082, pid=10256, tid=3960
      #
      # JRE version: Java(TM) SE Runtime Environment (13.0.1+9) (build 13.0.1+9)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (13.0.1+9, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
      # Problematic frame:
      # V [jvm.dll+0x547082]
      #
      # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #

      --------------- S U M M A R Y ------------

      Command Line: --enable-preview -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1\lib\idea_rt.jar=60302:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1\bin -Dfile.encoding=UTF-8 Main

      Host: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz, 8 cores, 31G, Windows 10 , 64 bit Build 18362 (10.0.18362.329)
      Time: Tue Jan 7 17:47:02 2020 Eastern Standard Time elapsed time: 0 seconds (0d 0h 0m 0s)

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

      Current thread (0x000001f4e3acc800): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=3960, stack(0x0000002821000000,0x0000002821100000)]


      Current CompileTask:
      C2: 80 192 4 Main::getPermutations (84 bytes)

      Stack: [0x0000002821000000,0x0000002821100000], sp=0x00000028210fa870, free space=1002k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [jvm.dll+0x547082]
      V [jvm.dll+0x546e26]
      V [jvm.dll+0x5461eb]
      V [jvm.dll+0x20fb86]
      V [jvm.dll+0x20921d]
      V [jvm.dll+0x2069bd]
      V [jvm.dll+0x18b94c]
      V [jvm.dll+0x2159bd]
      V [jvm.dll+0x213e6b]
      V [jvm.dll+0x738b16]
      V [jvm.dll+0x731c0a]
      V [jvm.dll+0x6260c6]
      C [ucrtbase.dll+0x20e72]
      C [KERNEL32.DLL+0x17bd4]
      C [ntdll.dll+0x6ced1]



      ACTUAL -
      A fatal error

      ---------- BEGIN SOURCE ----------
      public class Main {

        public static void getPermutations(byte[] inputArray, byte[][] outputArray) {
          int[] indexes = new int[]{0, 2};

          for (int a = 0; a < inputArray.length; a++) {
            int oneIdx = indexes[0]++;
            for (int b = a + 1; b < inputArray.length; b++) {
              int twoIdx = indexes[1]++;
              outputArray[twoIdx][0] = inputArray[a];
              outputArray[twoIdx][1] = inputArray[b];
            }
          }
        }

        public static void main(String[] args) {

          final byte[] inputArray = new byte[]{0, 1};
          final byte[][] outputArray = new byte[3][2];

          while (true) {
            getPermutations(inputArray, outputArray);
          }
        }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The workaround I have found is to not use the unary operator on the array element. That removes the fatal error.

      FREQUENCY : always


        Attachments

        1. hs_err_pid15381.log
          23 kB
        2. hs_err_pid5804.log
          53 kB
        3. replay_pid15381.log
          78 kB
        4. replay_pid5804.log
          99 kB

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: