JDK-8360035 : JDK 11 HotSpot C2 Compiler Crash in PhaseIterGVN with Infinite Loop Optimization
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11.0.27
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2025-06-18
  • Updated: 2025-06-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11-poolUnresolved
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
wsl2-ubuntu 22.04
Linux 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

java 11.0.27 2025-04-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.27+8-LTS-232)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.27+8-LTS-232, mixed mode)

A DESCRIPTION OF THE PROBLEM :
The following test program will crash Java Runtime Environment in JDK 11. However, it executes normally in JDK 8, 17 and 21.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Using JDK 11, run the following command:
```
javac Test.java
java Test
```

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should execute normally.
ACTUAL -
The program will crash Java Runtime Environment.
```
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f136b1d1761, pid=12332, tid=12344
#
# JRE version: Java(TM) SE Runtime Environment 18.9 (11.0.27+8) (build 11.0.27+8-LTS-232)
# Java VM: Java HotSpot(TM) 64-Bit Server VM 18.9 (11.0.27+8-LTS-232, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xc72761]  PhaseIterGVN::add_users_to_worklist(Node*)+0x11
...
```

---------- BEGIN SOURCE ----------
``` 
class Test {

    static int val = 0;

    public static int foo(int val) {
        return val + 1000;
    }

    public static void test() {
        Object[] arr = new Object[10];
        System.arraycopy(arr, 1, arr, 3, 5);
        System.arraycopy(arr, 2, arr, 4, 6);
        for (int i = 0; i < 100; i++) {
            val = i;
            if (val == 50) {
                val = foo(val);
            }
            long a = 0L;
            short b = (short) 123.45;
            while (true) {
                b = (byte) i;
            }
        }
    }

    public static void main(String[] argv) {
        for (int i = 0; i < 15000; i++) test();
    }
}
```
---------- END SOURCE ----------


Comments
The ArrayCopy node has the missing projection removed between the phases "Incremental Boxing Inline" and "PhaseIdealLoop before EA".
23-06-2025

Cannot reproduce with 17u or newer versions. With a fastdebug build I get the following with 11u: # To suppress the following error report, specify this argument # after -XX: or in .hotspotrc: SuppressErrorAt=/callnode.cpp:926 # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/opt/mach5/mesos/work_dir/slaves/03ecc23a-edd5-4bb5-a333-4ff8ea07fd7c-S1446/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/47e3ef36-0d5e-47de-b154-e03b4366d7ab/runs/5664ffc6-fa03-47ce-a048-73ce2d5ddfa6/workspace/open/src/hotspot/share/opto/callnode.cpp:926), pid=298067, tid=298091 # assert(!do_asserts || projs->fallthrough_ioproj != __null) failed: must be found
19-06-2025