JDK-8312980 : C2: "malformed control flow" created during incremental inlining
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-07-25
  • Updated: 2023-11-10
  • Resolved: 2023-10-25
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 22
22 b21Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8313208 :  
Description
Generic bug title, please change it to something more descriptive once the root cause is known.

The test java/util/concurrent/tck/JSR166TestCase.java is failing intermittently in our CI with the assertion below. I was not able to reproduce this by running the test, yet. However, the attached replay file can reduce the failure.

To reproduce:
$ java -XX:+ReplayCompiles -XX:+ReplayIgnoreInitErrors -XX:ReplayDataFile=r.log

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\sb\prod\1690244353\workspace\open\src\hotspot\share\opto\compile.cpp:3996), pid=11052, tid=12172
#  assert(false) failed: malformed control flow
Comments
Changeset: b026d0b4 Author: Roland Westrelin <roland@openjdk.org> Date: 2023-10-25 13:32:56 +0000 URL: https://git.openjdk.org/jdk/commit/b026d0b480dcd4c0a3346078dd10047653ed3751
25-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15905 Date: 2023-09-25 15:49:12 +0000
25-09-2023

I attached a test case that I think causes a similar failure: $ java -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+PrintCompilation -XX:+PrintInlining -XX:+AlwaysIncrementalInline -XX:CompileOnly=TestReplacedNodesAfterLateInline::test -XX:CompileCommand=quiet TestReplacedNodesAfterLateInline fails with "Bad graph detected in build_loop_late" Bug is in ReplaceNodes code AFAICT
14-09-2023

The replay file r.log could be used to trace back where the malformed graph assert is first hit. I found JDK-8292275 which seems to be unrelated to the root cause. It probably just changes the class file in such a way that it reveals an existing bug. So, it could be possible that this is an older issue that was present before JDK 21.
27-07-2023

I've set the initial ILW to P4. Even though, it's a regression, we will not crash with product and simply bail out. Once the root cause is known, we could still increase the priority if it's something more critical that needs to be addressed in the ongoing release of JDK 21.
25-07-2023

ILW = Assert in debug build and bailout in product, single test and intermittent, no workaround = MLH = P4
25-07-2023