JDK-8237951 : CTW: C2 compilation fails with "malformed control flow"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,11,15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-01-28
  • Updated: 2020-07-01
  • Resolved: 2020-02-04
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 JDK 13 JDK 14 JDK 15 Other
11.0.8-oracleFixed 13.0.4Fixed 14.0.2Fixed 15 b09Fixed openjdk8u272Fixed
Description
$ cd test/hotspot/jtreg/testlibrary/ctw
$ make
$ cd dist
$ wget https://repo1.maven.org/maven2/com/liferay/com.liferay.wiki.service/2.0.8/com.liferay.wiki.service-2.0.8.jar
$ JAVA_OPTIONS="-XX:+AbortVMOnCompilationFailure -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ShenandoahVerifyOptoBarriers" ./ctw.sh com.liferay.wiki.service-2.0.8.jar 

#  Internal Error (/home/shade/trunks/jdk-jdk/src/hotspot/share/compiler/compileBroker.cpp:2009), pid=18437, tid=18447
#  fatal error: Not compilable at tier 4: malformed control flow
#
# JRE version: OpenJDK Runtime Environment (15.0) (fastdebug build 15-internal+0-adhoc.shade.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 15-internal+0-adhoc.shade.jdk-jdk, mixed mode, sharing, tiered, compressed oops, shenandoah gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x882133]  CompileBroker::post_compile(CompilerThread*, CompileTask*, bool, ciEnv*, int, char const*)+0x1b3

It looks Shenandoah-specific, as I could not get it to fail with G1. (It requires additional  -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=6000 to get past the node limits).
Comments
OK, thanks for the info. Given that it might also cause crashes I'll approve it on the basis that this is also considered a low risk fix.
30-06-2020

[~sgehwolf] Bailing out of compilation could affect performance if the method that ends up not compiled is an important method for the application. Also, the compiler bails out because the compilation process goes wrong and while it has not been seen to cause a crash it 's hard to rule it out with certainty either. Given how simple and low risk the fix is, I think it makes sense to have it in 8u but I agree it's not the most critical one either.
30-06-2020

[~roland] Could you elaborate why we should fix this for OpenJDK 8u? Is "unnecessary compilation bailout" enough of a reason to change compiler code in OpenJDK 8u? What's the associated risk?
30-06-2020

Fix request (13u): The original change applies cleanly, passes tier1,tier2,tier3 tests.
05-06-2020

Fix Request (8u) This fixes an unnecessary compilation bailout. Patch does not apply cleanly to 8u and requires some adjustments. 8u RFR: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-April/011513.html
02-04-2020

Fix Request (JDK 14.0.2) The patch fixes an unnecessary compilation bailout and has already been backported to JDK 11u. The fix is low risk and applies cleanly to JDK 14.0.2. In addition to CI testing through all tiers in JDK 15 and 11u, additional testing will be executed in JDK 14.0.2 before pushing.
06-03-2020

Fix Request (11u) This fixes the unnecessary compilation bailout and keeps codebases in sync (I see 11.0.8-oracle). Patch applies cleanly to 11u, passes tier{1,2,3} tests.
29-02-2020

The patch applies to 8u after reshuffling, so I assume it might be a problem there as well. Adding provisional affected-versions.
28-02-2020

Changeset: f2b7509d Author: Roland Westrelin <roland@openjdk.org> Date: 2020-01-28 13:36:30 +0000 URL: https://git.openjdk.java.net/panama-foreign/commit/f2b7509d
07-02-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/c7152f7e01a6 User: roland Date: 2020-02-04 08:17:37 +0000
04-02-2020

Bug triggers with Shenandoah but is not Shenandoah specific
29-01-2020