JDK-8331717 : C2: Crash with SIGFPE
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,16,17,21,22,23,24
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-05-06
  • Updated: 2024-11-18
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 25
25Unresolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The attached Java Fuzzer test crashes with a SIGFPE after JDK-8259227.

To reproduce:
$ java -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch Test.java
$ java -XX:CompileCommand=compileonly,*Reduced*::* -XX:-TieredCompilation -Xbatch Reduced.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGFPE (0x8) at pc=0x000078e8d8d8a34b, pid=229233, tid=229234
#
# JRE version: Java(TM) SE Runtime Environment (23.0+21) (fastdebug build 23-ea+21-1729)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-ea+21-1729, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# J 97% c2 Test.test()V (57 bytes) @ 0x000078e8d8d8a34b [0x000078e8d8d8a2a0+0x00000000000000ab]
.............
Command Line: -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher Test.java
.............
Stack: [0x000078e8dbc19000,0x000078e8dbd19000],  sp=0x000078e8dbd17370,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 97% c2 Test.test()V (57 bytes) @ 0x000078e8d8d8a34b [0x000078e8d8d8a2a0+0x00000000000000ab]
j  Test.main([Ljava/lang/String;)V+9
j  java.lang.invoke.LambdaForm$DMH+0x000078e863028400.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@23-ea
j  java.lang.invoke.LambdaForm$MH+0x000078e863149400.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+33 java.base@23-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@23-ea
j  jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+55 java.base@23-ea
j  jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@23-ea
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@23-ea
j  com.sun.tools.javac.launcher.SourceLauncher.execute(Lcom/sun/tools/javac/launcher/MemoryContext;[Ljava/lang/String;)Ljava/lang/Class;+447 jdk.compiler@23-ea
j  com.sun.tools.javac.launcher.SourceLauncher.run([Ljava/lang/String;[Ljava/lang/String;)Lcom/sun/tools/javac/launcher/Result;+62 jdk.compiler@23-ea
j  com.sun.tools.javac.launcher.SourceLauncher.main([Ljava/lang/String;)V+17 jdk.compiler@23-ea
v  ~StubRoutines::call_stub 0x000078e8d8c19d01
V  [libjvm.so+0xe68739]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x4a9
V  [libjvm.so+0xfa04f0]  jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) [clone .constprop.1]+0x360
V  [libjvm.so+0xfa3bf3]  jni_CallStaticVoidMethod+0x193
C  [libjli.so+0x3a00]  invokeStaticMainWithArgs+0x70
C  [libjli.so+0x49dd]  JavaMain+0xd9d
C  [libjli.so+0x7cb9]  ThreadJavaMain+0x9

siginfo: si_signo: 8 (SIGFPE), si_code: 1 (FPE_INTDIV), si_addr: 0x000078e8d8d8a34b
Comments
Attaching another test (Test2/Reduced2.java) which crashes with SIGFPE: $ java -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch Test2.java $ java -XX:CompileCommand=compileonly,*Reduced*::* -XX:-TieredCompilation -Xbatch Reduced2.java Might be unrelated. This starts to fail with a GC other than G1 (for example, ZGC) after JDK-8333252. But JDK-8333252 only disabled Loop Predication for single iteration loops. It therefore must have revealed an existing issue. It's hard to tell if both test cases are the same underlying issue. If not, please file a separate issue. # # A fatal error has been detected by the Java Runtime Environment: # # SIGFPE (0x8) at pc=0x00007e38dc7601c0, pid=842786, tid=842787 # # JRE version: Java(TM) SE Runtime Environment (24.0+25) (fastdebug build 24-ea+25-3042) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-ea+25-3042, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # J 85% c2 Reduced.test()V (93 bytes) @ 0x00007e38dc7601c0 [0x00007e38dc760100+0x00000000000000c0]
18-11-2024

Deferring to JDK 25 for now because this is an old issue. Feel free to re-target to JDK 24 if the fix is ready in time.
17-10-2024

Seems unrelated to JDK-8336729 while JDK-8336704 seems to be a dup. Please confirm again once a fix is ready (use Test2.java which is the reproducer from JDK-8336704).
15-08-2024

Attached Test2.java from JDK-8336704: $ java -Xbatch Test2.java
15-08-2024

Another report came in: JDK-8336704. Please verify that it's the same issue once a fix is ready. It could also be JDK-8336729.
18-07-2024

Seems unrelated to JDK-8331575.
06-05-2024

ILW = SIGFPE crash with C2 compiled code, single fuzzer test, disable compilation of affected method = HLM = P3
06-05-2024