JDK-8237900 : CTW: C2 compilation bails with "unsupported calling sequence" due to too many outgoing arguments
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 15
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2020-01-27
  • Updated: 2024-02-08
  • Resolved: 2020-04-06
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 15
15Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
$ cd test/hotspot/jtreg/testlibrary/ctw
$ make
$ cd dist
$ wget https://repo1.maven.org/maven2/com/elastisys/scale/commons.logreplayer/2.3.4/commons.logreplayer-2.3.4.jar
$ JAVA_OPTIONS="-XX:+AbortVMOnCompilationFailure" ./ctw.sh commons.logreplayer-2.3.4.jar

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/compileBroker.cpp:2009
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/shade/trunks/jdk-jdk/src/hotspot/share/compiler/compileBroker.cpp:2009), pid=15843, tid=15876
#  fatal error: Not compilable at tier 4: unsupported calling sequence
#
# 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, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x8820a3]  CompileBroker::post_compile(CompilerThread*, CompileTask*, bool, ciEnv*, int, char const*)+0x1b3
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/shade/trunks/jdk-jdk/test/hotspot/jtreg/testlibrary/ctw/dist/core.15843)
#

More failures with:
 https://repo1.maven.org/maven2/org/eu/acolyte/acolyte-core/1.0.13/acolyte-core-1.0.13.jar
Comments
Only happens with -XX:+AbortVMOnCompilationFailure when C2 bails out of the compilation at [1] due to too many outgoing arguments. This is expected since C2 reaches the maximum number of allowed stack arguments/slots. Looking at the bytecode of com.ning.http.client.AsyncHttpClientConfig::<init>, we can see that the constructor has 34 parameters and then calls again another constructor with 33 arguments. This requires too many stack arguments/slots for C2 to handle them and it bails out. This behavior can also be verified by running the small test program below with "-Xcomp -Xbatch -XX:CompileCommand=compileonly,"Test::<init>" -XX:CompileCommand=dontinline,"Test::<init>". C2 bails out when compiling Test::<init>, which in this case only defines 32 parameters and calls another constructor with 31 arguments", with "Not compilable at tier 4: unsupported calling sequence". Tiered policy would recompile it on tier 1 (C1). Non-tiered policy would bail to interpreter. I'm closing this as not an issue. [1] http://hg.openjdk.java.net/jdk/jdk/file/f82f59ef79f0/src/hotspot/share/opto/matcher.cpp#l1113 public class Test { public static void main(String[] strArr) { new Test(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } public Test(A a0, A a1, A a2, A a3, A a4, A a5, A a6, A a7, A a8, A a9, A a10, A a11, A a12, A a13, A a14, A a15, A a16, A a17, A a18, A a19, A a20, A a21, A a22, A a23, A a24, A a25, A a26, A a27, A a28, A a29, A a30) { } public Test(A a0, A a1, A a2, A a3, A a4, A a5, A a6, A a7, A a8, A a9, A a10, A a11, A a12, A a13, A a14, A a15, A a16, A a17, A a18, A a19, A a20, A a21, A a22, A a23, A a24, A a25, A a26, A a27, A a28, A a29, A a30, A a31) { this(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30); } } class A { } Recompile at C1: 9898 91 b 3 bla.Test1::<init> (64 bytes) 9902 92 b 4 bla.Test1::<init> (64 bytes) 9903 92 b 4 bla.Test1::<init> (64 bytes) COMPILE SKIPPED: unsupported calling sequence (retry at different tier) 9908 95 b 1 bla.Test1::<init> (64 bytes) 9911 91 3 bla.Test1::<init> (64 bytes) made not entrant Bailout to interpreter with -XX:-TieredCompilation: 8665 91 b bla.Test1::<init> (64 bytes) 8667 91 b bla.Test1::<init> (64 bytes) COMPILE SKIPPED: unsupported calling sequence (not retryable)
14-02-2020