-
Bug
-
Resolution: Fixed
-
P3
-
17, 20
-
b14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8296382 | 17.0.7-oracle | Tobias Hartmann | P3 | Resolved | Fixed | b01 |
JDK-8299369 | 17.0.7 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
The attached reduced Java Fuzzer test from
To reproduce:
$ java -Xcomp -XX:CompileOnly=Test Test.java
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (src/hotspot/share/opto/block.cpp:1742), pid=36133, tid=36146
# assert(_cfg.number_of_blocks() >= (uint) (size - 1)) failed: number of blocks can not shrink
#
# JRE version: Java(TM) SE Runtime Environment (20.0+11) (fastdebug build 20-ea+11-661)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+11-661, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x770b84] PhaseBlockLayout::PhaseBlockLayout(PhaseCFG&)+0x7d4
.......
Command Line: -Xcomp -XX:CompileOnly=Test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
.......
Current CompileTask:
C2: 1763 85 b 4 Test::test (47 bytes)
FAILURE ANALYSIS:
The failure unveils three major flaws in the current removal of unreachable blocks after NeverBranch-to-goto conversion (introduced in
1. The unreachable block removal and pre-order index update loop [1] skips the block next to the removed one, and iterates beyond the end of the block count ('_number_of_blocks').
2. The outer block traversal loop [2] iterates beyond the end of the block count whenever one or more unreachable blocks are removed.
3. Transitively unreachable blocks (such as B10 in transitive.pdf) are not removed. These blocks arise in methods with two or more infinite loops (see multiple-infinite-loops.pdf).
[1] https://github.com/openjdk/jdk/blob/7b5f9edb59ef763acca80724ca37f3624d720d06/src/hotspot/share/opto/block.cpp#L613-L621
[2] https://github.com/openjdk/jdk/blob/7b5f9edb59ef763acca80724ca37f3624d720d06/src/hotspot/share/opto/block.cpp#L698-L729
- backported by
-
JDK-8296382 C2: blocks made unreachable by NeverBranch-to-Goto conversion are removed incorrectly
-
- Resolved
-
-
JDK-8299369 C2: blocks made unreachable by NeverBranch-to-Goto conversion are removed incorrectly
-
- Resolved
-
- duplicates
-
JDK-8292730 Shenandoah: gc/shenandoah/compiler/BarrierInInfiniteLoop.java fails on aarch64, ppcle
-
- Closed
-
-
JDK-8292859 test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java timeouts after JDK-8292285
-
- Closed
-
- relates to
-
JDK-8292730 Shenandoah: gc/shenandoah/compiler/BarrierInInfiniteLoop.java fails on aarch64, ppcle
-
- Closed
-
-
JDK-8292285 C2: remove unreachable block after NeverBranch-to-Goto conversion
-
- Resolved
-
- links to
-
Commit openjdk/jdk17u-dev/8b0c5b92
-
Commit openjdk/jdk/730ced9a
-
Review openjdk/jdk17u-dev/979
-
Review openjdk/jdk/9976