-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 25
-
Component/s: hotspot
The attached Java Fuzzer test endlessly creates new nodes during IGVN which either leads to a memlimit hit or to a compilation bailout due to running out of nodes.
To reproduce (check with both once we have a fix):
- Mem limit hit with original Test.java:
$ java -XX:CompileCommand=compileonly,*Test*::mainTest -XX:-TieredCompilation -Xbatch -XX:RepeatCompilation=10 -XX:+StressLoopPeeling Test.java
- Node limit hit with reduced test Reduced.java (we run with AbortVMOnCompilationFailure to abort the VM in that case):
$ java -XX:+AbortVMOnCompilationFailure -XX:CompileCommand=compileonly,*Reduced*::test -XX:-TieredCompilation -Xbatch -XX:RepeatCompilation=10 -XX:+StressLoopPeeling -XX:+TraceLoopOpts Reduced.java
Dump of worklist when bailing out when reaching the node limit with Reduced.java:
0--> 391 StoreL === 1015 948 177 393 [[ 16 ]] @instptr:Reduced:BotPTR+16,iid=bot, name=instanceCount, idx=5; Memory: @instptr:Reduced:NotNull+16,iid=bot, name=instanceCount, idx=5; !orig=312 !jvms: Reduced::test @ bci:101 (line 28)
1--> 911 SubI === _ 951 912 [[ 907 910 ]] !orig=559,501,395,[272],542 !jvms: Reduced::test @ bci:68 (line 25)
2--> 1301 SubL === _ 1142 981 [[ 1298 ]] !orig=[1296]
3--> 1424 SubL === _ 826 696 [[ 1421 ]] !orig=[1419]
4--> 1482 SubL === _ 1485 700 [[ 1476 ]] !orig=[1474]
5--> 1484 ConvI2L === _ 703 [[ 1485 9234 ]] #long:-255..255, 0u..maxulong
6--> 1483 ConvI2L === _ 708 [[ 1485 14023 ]] #long:-128..127, 0u..maxulong
7--> 1460 SubL === _ 1463 989 [[ 1457 ]] !orig=[1455]
8--> 1479 AddL === _ 954 251 [[ 1477 ]]
9--> 1477 SubL === _ 1486 1479 [[ 948 ]] !orig=[949],393,[310] !jvms: Reduced::test @ bci:100 (line 28)
10--> 1364 SubL === _ 1029 1001 [[ 1361 ]] !orig=[1359]
11--> 1486 SubL === _ 1489 1492 [[ 1477 ]] !orig=[1478]
12--> 1494 AddL === _ 251 251 [[ 1492 ]]
13--> 1489 SubL === _ 1495 1498 [[ 1486 ]] !orig=[1487]
14--> 1500 AddL === _ 251 251 [[ 1498 ]]
15--> 1492 SubL === _ 1501 1494 [[ 1486 ]] !orig=[1488]
16--> 1495 SubL === _ 1504 1507 [[ 1489 ]] !orig=[1490]
17--> 1509 AddL === _ 251 251 [[ 1507 ]]
18--> 1498 SubL === _ 1510 1500 [[ 1489 ]] !orig=[1491]
19--> 1501 SubL === _ 1513 1516 [[ 1492 ]] !orig=[1493]
20--> 1518 AddL === _ 251 251 [[ 1516 ]]
21--> 1504 SubL === _ 1519 1522 [[ 1495 ]] !orig=[1496]
22--> 1524 AddL === _ 251 251 [[ 1522 ]]
23--> 1507 SubL === _ 1525 1509 [[ 1495 ]] !orig=[1497]
24--> 1510 SubL === _ 1528 1531 [[ 1498 ]] !orig=[1499]
25--> 1533 AddL === _ 251 251 [[ 1531 ]]
26--> 1513 SubL === _ 1534 1537 [[ 1501 ]] !orig=[1502]
27--> 1539 AddL === _ 251 251 [[ 1537 ]]
28--> 1516 SubL === _ 1540 1518 [[ 1501 ]] !orig=[1503]
29--> 1519 SubL === _ 1543 1546 [[ 1504 ]] !orig=[1505]
30--> 1548 AddL === _ 251 251 [[ 1546 ]]
.....
58900--> 124726 AddL === _ 704 704 [[ 124724 ]]
58901--> 124749 SubL === _ 124746 124756 [[ 124750 ]]
58902--> 76742 SubL === _ 124762 124763 [[ 47386 ]] !orig=[47387]
58903--> 124770 SubL === _ 124767 124777 [[ 124771 ]]
58904--> 76754 SubL === _ 124783 124784 [[ 47392 ]] !orig=[47393]
58905--> 124785 AddL === _ 817 817 [[ 124784 ]]
58906--> 76757 SubL === _ 124792 124793 [[ 47395 ]] !orig=[47396]
58907--> 124794 AddL === _ 817 817 [[ 124793 ]]
58908--> 124797 AddL === _ 817 817 [[ 124796 ]]
58909--> 124803 SubL === _ 124800 124810 [[ 124804 ]]
58910--> 76772 SubL === _ 124816 124817 [[ 47401 ]] !orig=[47402]
58911--> 124818 AddL === _ 817 817 [[ 124817 ]]
58912--> 76775 SubL === _ 124825 124826 [[ 47404 ]] !orig=[47405]
58913--> 124827 AddL === _ 817 817 [[ 124826 ]]
58914--> 124830 AddL === _ 817 817 [[ 124829 ]]
58915--> 124831 AddL === _ 704 704 [[ 124829 ]]
58916--> 76778 SubL === _ 124829 76780 [[ 47404 ]] !orig=[47406]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/chagedor/jdk/open/src/hotspot/share/compiler/compileBroker.cpp:2152), pid=302548, tid=302567
# fatal error: Not compilable at tier 4: Out of nodes
#
# JRE version: Java(TM) SE Runtime Environment (27.0) (slowdebug build 27-internal-chagedor.open)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 27-internal-chagedor.open, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xac688c] CompileBroker::handle_compile_error(CompilerThread*, CompileTask*, ciEnv*, int, char const*)+0x40
Hitting memlimit with Test.java:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S28299/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f91fc488-c371-41ce-a776-517c726e2491/runs/075e4d8e-4766-413e-9e30-0b3e1f2c7673/workspace/open/src/hotspot/share/compiler/compilationMemoryStatistic.cpp:935), pid=2545202, tid=2545241
# fatal error: c2 (39) Test_918::mainTest(([Ljava/lang/String;)V): Hit MemLimit - limit: 1073741824 now: 1074247816
#
# JRE version: Java(TM) SE Runtime Environment (27.0+4) (fastdebug build 27-ea+4-242)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-ea+4-242, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Core dump will be written. Default location: Determined by the following: "/opt/core.sh %p" (alternatively, falling back to /opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S11715/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f675aea6-cbb4-48e2-b9e1-056ba49ee705/runs/786dbf39-6165-481c-8f45-6532041b645b/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_JF_5000Tests_java/scratch/0/generated/javafuzzer_tests/core.2545202)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
--------------- S U M M A R Y ------------
Command Line: -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=1834674440 -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:+StressLoopPeeling Test_918
Host: AArch64, 8 cores, 31G, Oracle Linux Server release 8.10
Time: Thu Dec 25 20:05:55 2025 UTC elapsed time: 93.040734 seconds (0d 0h 1m 33s)
--------------- T H R E A D ---------------
Current thread (0x0000ffff8018f1e0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=2545241, stack(0x0000ffff47805000,0x0000ffff47a03000) (2040K)]
Current CompileTask:
C2:93040 39 b Test_918::mainTest (525 bytes)
Stack: [0x0000ffff47805000,0x0000ffff47a03000], sp=0x0000ffff479fcdb0, free space=2015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x197cd04] VMError::report(outputStream*, bool)+0x3164 (compilationMemoryStatistic.cpp:935)
V [libjvm.so+0x1980b8c] VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x4dc (vmError.cpp:1888)
V [libjvm.so+0xab3350] report_fatal(VMErrorType, char const*, int, char const*, ...)+0xf0 (debug.cpp:223)
V [libjvm.so+0x9be710] CompilationMemoryStatistic::on_arena_chunk_allocation(unsigned long, int, unsigned long*)+0x630 (compilationMemoryStatistic.cpp:935)
V [libjvm.so+0x667b4c] ChunkPool::allocate_chunk(Arena*, unsigned long, AllocFailStrategy::AllocFailEnum)+0x14c (arena.cpp:203)
V [libjvm.so+0x668fa4] Arena::grow(unsigned long, AllocFailStrategy::AllocFailEnum)+0x84 (arena.cpp:337)
V [libjvm.so+0xb948e4] PhaseIdealLoop::Dominators()+0xbd8 (domgraph.cpp:625)
V [libjvm.so+0x134bd84] PhaseIdealLoop::build_and_optimize()+0x364 (loopnode.cpp:5099)
V [libjvm.so+0x9f0208] PhaseIdealLoop::verify(PhaseIterGVN&)+0x3c8 (loopnode.hpp:1248)
V [libjvm.so+0x9e7704] Compile::process_for_post_loop_opts_igvn(PhaseIterGVN&)+0x20 (compile.cpp:1877)
V [libjvm.so+0x9ebea8] Compile::Optimize()+0xaa8 (compile.cpp:2525)
V [libjvm.so+0x9ee44c] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x16a0 (compile.cpp:862)
V [libjvm.so+0x815918] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x2d4 (c2compiler.cpp:147)
V [libjvm.so+0x9fd1cc] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb08 (compileBroker.cpp:2345)
V [libjvm.so+0x9fe0f8] CompileBroker::compiler_thread_loop()+0x638 (compileBroker.cpp:1989)
V [libjvm.so+0xf08248] JavaThread::thread_main_inner()+0x108 (javaThread.cpp:776)
V [libjvm.so+0x1890d4c] Thread::call_run()+0xac (thread.cpp:242)
V [libjvm.so+0x155ecfc] thread_native_entry(Thread*)+0x11c (os_linux.cpp:860)
C [libpthread.so.0+0x7950] start_thread+0x190
To reproduce (check with both once we have a fix):
- Mem limit hit with original Test.java:
$ java -XX:CompileCommand=compileonly,*Test*::mainTest -XX:-TieredCompilation -Xbatch -XX:RepeatCompilation=10 -XX:+StressLoopPeeling Test.java
- Node limit hit with reduced test Reduced.java (we run with AbortVMOnCompilationFailure to abort the VM in that case):
$ java -XX:+AbortVMOnCompilationFailure -XX:CompileCommand=compileonly,*Reduced*::test -XX:-TieredCompilation -Xbatch -XX:RepeatCompilation=10 -XX:+StressLoopPeeling -XX:+TraceLoopOpts Reduced.java
Dump of worklist when bailing out when reaching the node limit with Reduced.java:
0--> 391 StoreL === 1015 948 177 393 [[ 16 ]] @instptr:Reduced:BotPTR+16,iid=bot, name=instanceCount, idx=5; Memory: @instptr:Reduced:NotNull+16,iid=bot, name=instanceCount, idx=5; !orig=312 !jvms: Reduced::test @ bci:101 (line 28)
1--> 911 SubI === _ 951 912 [[ 907 910 ]] !orig=559,501,395,[272],542 !jvms: Reduced::test @ bci:68 (line 25)
2--> 1301 SubL === _ 1142 981 [[ 1298 ]] !orig=[1296]
3--> 1424 SubL === _ 826 696 [[ 1421 ]] !orig=[1419]
4--> 1482 SubL === _ 1485 700 [[ 1476 ]] !orig=[1474]
5--> 1484 ConvI2L === _ 703 [[ 1485 9234 ]] #long:-255..255, 0u..maxulong
6--> 1483 ConvI2L === _ 708 [[ 1485 14023 ]] #long:-128..127, 0u..maxulong
7--> 1460 SubL === _ 1463 989 [[ 1457 ]] !orig=[1455]
8--> 1479 AddL === _ 954 251 [[ 1477 ]]
9--> 1477 SubL === _ 1486 1479 [[ 948 ]] !orig=[949],393,[310] !jvms: Reduced::test @ bci:100 (line 28)
10--> 1364 SubL === _ 1029 1001 [[ 1361 ]] !orig=[1359]
11--> 1486 SubL === _ 1489 1492 [[ 1477 ]] !orig=[1478]
12--> 1494 AddL === _ 251 251 [[ 1492 ]]
13--> 1489 SubL === _ 1495 1498 [[ 1486 ]] !orig=[1487]
14--> 1500 AddL === _ 251 251 [[ 1498 ]]
15--> 1492 SubL === _ 1501 1494 [[ 1486 ]] !orig=[1488]
16--> 1495 SubL === _ 1504 1507 [[ 1489 ]] !orig=[1490]
17--> 1509 AddL === _ 251 251 [[ 1507 ]]
18--> 1498 SubL === _ 1510 1500 [[ 1489 ]] !orig=[1491]
19--> 1501 SubL === _ 1513 1516 [[ 1492 ]] !orig=[1493]
20--> 1518 AddL === _ 251 251 [[ 1516 ]]
21--> 1504 SubL === _ 1519 1522 [[ 1495 ]] !orig=[1496]
22--> 1524 AddL === _ 251 251 [[ 1522 ]]
23--> 1507 SubL === _ 1525 1509 [[ 1495 ]] !orig=[1497]
24--> 1510 SubL === _ 1528 1531 [[ 1498 ]] !orig=[1499]
25--> 1533 AddL === _ 251 251 [[ 1531 ]]
26--> 1513 SubL === _ 1534 1537 [[ 1501 ]] !orig=[1502]
27--> 1539 AddL === _ 251 251 [[ 1537 ]]
28--> 1516 SubL === _ 1540 1518 [[ 1501 ]] !orig=[1503]
29--> 1519 SubL === _ 1543 1546 [[ 1504 ]] !orig=[1505]
30--> 1548 AddL === _ 251 251 [[ 1546 ]]
.....
58900--> 124726 AddL === _ 704 704 [[ 124724 ]]
58901--> 124749 SubL === _ 124746 124756 [[ 124750 ]]
58902--> 76742 SubL === _ 124762 124763 [[ 47386 ]] !orig=[47387]
58903--> 124770 SubL === _ 124767 124777 [[ 124771 ]]
58904--> 76754 SubL === _ 124783 124784 [[ 47392 ]] !orig=[47393]
58905--> 124785 AddL === _ 817 817 [[ 124784 ]]
58906--> 76757 SubL === _ 124792 124793 [[ 47395 ]] !orig=[47396]
58907--> 124794 AddL === _ 817 817 [[ 124793 ]]
58908--> 124797 AddL === _ 817 817 [[ 124796 ]]
58909--> 124803 SubL === _ 124800 124810 [[ 124804 ]]
58910--> 76772 SubL === _ 124816 124817 [[ 47401 ]] !orig=[47402]
58911--> 124818 AddL === _ 817 817 [[ 124817 ]]
58912--> 76775 SubL === _ 124825 124826 [[ 47404 ]] !orig=[47405]
58913--> 124827 AddL === _ 817 817 [[ 124826 ]]
58914--> 124830 AddL === _ 817 817 [[ 124829 ]]
58915--> 124831 AddL === _ 704 704 [[ 124829 ]]
58916--> 76778 SubL === _ 124829 76780 [[ 47404 ]] !orig=[47406]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/chagedor/jdk/open/src/hotspot/share/compiler/compileBroker.cpp:2152), pid=302548, tid=302567
# fatal error: Not compilable at tier 4: Out of nodes
#
# JRE version: Java(TM) SE Runtime Environment (27.0) (slowdebug build 27-internal-chagedor.open)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 27-internal-chagedor.open, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xac688c] CompileBroker::handle_compile_error(CompilerThread*, CompileTask*, ciEnv*, int, char const*)+0x40
Hitting memlimit with Test.java:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S28299/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f91fc488-c371-41ce-a776-517c726e2491/runs/075e4d8e-4766-413e-9e30-0b3e1f2c7673/workspace/open/src/hotspot/share/compiler/compilationMemoryStatistic.cpp:935), pid=2545202, tid=2545241
# fatal error: c2 (39) Test_918::mainTest(([Ljava/lang/String;)V): Hit MemLimit - limit: 1073741824 now: 1074247816
#
# JRE version: Java(TM) SE Runtime Environment (27.0+4) (fastdebug build 27-ea+4-242)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-ea+4-242, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Core dump will be written. Default location: Determined by the following: "/opt/core.sh %p" (alternatively, falling back to /opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S11715/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f675aea6-cbb4-48e2-b9e1-056ba49ee705/runs/786dbf39-6165-481c-8f45-6532041b645b/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_JF_5000Tests_java/scratch/0/generated/javafuzzer_tests/core.2545202)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
--------------- S U M M A R Y ------------
Command Line: -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=1834674440 -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:+StressLoopPeeling Test_918
Host: AArch64, 8 cores, 31G, Oracle Linux Server release 8.10
Time: Thu Dec 25 20:05:55 2025 UTC elapsed time: 93.040734 seconds (0d 0h 1m 33s)
--------------- T H R E A D ---------------
Current thread (0x0000ffff8018f1e0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=2545241, stack(0x0000ffff47805000,0x0000ffff47a03000) (2040K)]
Current CompileTask:
C2:93040 39 b Test_918::mainTest (525 bytes)
Stack: [0x0000ffff47805000,0x0000ffff47a03000], sp=0x0000ffff479fcdb0, free space=2015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x197cd04] VMError::report(outputStream*, bool)+0x3164 (compilationMemoryStatistic.cpp:935)
V [libjvm.so+0x1980b8c] VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x4dc (vmError.cpp:1888)
V [libjvm.so+0xab3350] report_fatal(VMErrorType, char const*, int, char const*, ...)+0xf0 (debug.cpp:223)
V [libjvm.so+0x9be710] CompilationMemoryStatistic::on_arena_chunk_allocation(unsigned long, int, unsigned long*)+0x630 (compilationMemoryStatistic.cpp:935)
V [libjvm.so+0x667b4c] ChunkPool::allocate_chunk(Arena*, unsigned long, AllocFailStrategy::AllocFailEnum)+0x14c (arena.cpp:203)
V [libjvm.so+0x668fa4] Arena::grow(unsigned long, AllocFailStrategy::AllocFailEnum)+0x84 (arena.cpp:337)
V [libjvm.so+0xb948e4] PhaseIdealLoop::Dominators()+0xbd8 (domgraph.cpp:625)
V [libjvm.so+0x134bd84] PhaseIdealLoop::build_and_optimize()+0x364 (loopnode.cpp:5099)
V [libjvm.so+0x9f0208] PhaseIdealLoop::verify(PhaseIterGVN&)+0x3c8 (loopnode.hpp:1248)
V [libjvm.so+0x9e7704] Compile::process_for_post_loop_opts_igvn(PhaseIterGVN&)+0x20 (compile.cpp:1877)
V [libjvm.so+0x9ebea8] Compile::Optimize()+0xaa8 (compile.cpp:2525)
V [libjvm.so+0x9ee44c] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x16a0 (compile.cpp:862)
V [libjvm.so+0x815918] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x2d4 (c2compiler.cpp:147)
V [libjvm.so+0x9fd1cc] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb08 (compileBroker.cpp:2345)
V [libjvm.so+0x9fe0f8] CompileBroker::compiler_thread_loop()+0x638 (compileBroker.cpp:1989)
V [libjvm.so+0xf08248] JavaThread::thread_main_inner()+0x108 (javaThread.cpp:776)
V [libjvm.so+0x1890d4c] Thread::call_run()+0xac (thread.cpp:242)
V [libjvm.so+0x155ecfc] thread_native_entry(Thread*)+0x11c (os_linux.cpp:860)
C [libpthread.so.0+0x7950] start_thread+0x190