JDK-8289748 : C2 compiled code crashes with SIGFPE with -XX:+StressLCM and -XX:+StressGCM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,18,19,20,21
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2022-07-05
  • Updated: 2022-12-16
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 21
21Unresolved
Related Reports
Relates :  
Description
Note: Please change bug title to something more descriptive ones the problem is known.

The attached Java Fuzzer test crashes with SIGFPE:

// Maybe needs to be run several times if chosen seed is not working.
$ java -XX:-TieredCompilation -XX:+StressLCM -XX:+StressGCM -Xcomp -XX:CompileOnly=Test Test.java 

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGFPE (0x8) at pc=0x00007fe778b8d916, pid=72086, tid=72087
#
# JRE version: Java(TM) SE Runtime Environment (20.0+4) (fastdebug build 20-ea+4-158)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+4-158, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# J 107 c2 Test.mainTest([Ljava/lang/String;)V (546 bytes) @ 0x00007fe778b8d916 [0x00007fe778b8d6e0+0x0000000000000236]
..........
Command Line: -XX:-TieredCompilation -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -Xcomp -XX:CompileOnly=Test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
..........
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 107 c2 Test.mainTest([Ljava/lang/String;)V (546 bytes) @ 0x00007fe778b8d916 [0x00007fe778b8d6e0+0x0000000000000236]
J 105 c2 Test.main([Ljava/lang/String;)V (45 bytes) @ 0x00007fe778b90e60 [0x00007fe778b90de0+0x0000000000000080]
j  java.lang.invoke.LambdaForm$DMH+0x0000000801030000.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@20-ea
j  java.lang.invoke.LambdaForm$MH+0x0000000801149800.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+33 java.base@20-ea
j  java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+20 java.base@20-ea
j  jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+55 java.base@20-ea
j  jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@20-ea
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@20-ea
j  com.sun.tools.javac.launcher.Main.execute(Ljava/lang/String;[Ljava/lang/String;Lcom/sun/tools/javac/launcher/Main$Context;)V+128 jdk.compiler@20-ea
j  com.sun.tools.javac.launcher.Main.run([Ljava/lang/String;[Ljava/lang/String;)V+54 jdk.compiler@20-ea
j  com.sun.tools.javac.launcher.Main.main([Ljava/lang/String;)V+17 jdk.compiler@20-ea
v  ~StubRoutines::call_stub 0x00007fe778b42d47
V  [libjvm.so+0x1015fe4]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x514
V  [libjvm.so+0x1169515]  jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) [clone .constprop.1]+0x385
V  [libjvm.so+0x116ca25]  jni_CallStaticVoidMethod+0x1b5
C  [libjli.so+0x47e5]  JavaMain+0xd65
C  [libjli.so+0x7a19]  ThreadJavaMain+0x9
Comments
Deferred to JDK 21, see justification in PR: https://github.com/openjdk/jdk20/pull/8#issuecomment-1347957252
13-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20/pull/8 Date: 2022-12-09 11:12:35 +0000
09-12-2022

also crashes with `jdk/build/linux-x64-debug/jdk/bin/java -XX:-TieredCompilation -Xcomp -XX:CompileOnly=Reproduce::main Reproduce.java`
16-11-2022

ILW = Crash in C2 compiled code, only single Java Fuzzer test with Stress flags, disable compilation of affected method = HLM = P3
05-07-2022