JDK-8291466 : C2: assert(false) failed: infinite loop in PhaseIterGVN::transform_old with -XX:+StressIGVN
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2022-07-28
  • Updated: 2022-08-10
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 20
20Unresolved
Related Reports
Relates :  
Relates :  
Description
On attached Fuzzer test:

$ build/linux-x86_64-server-fastdebug/images/jdk/bin/java -XX:-TieredCompilation -XX:+StressIGVN -Xcomp -XX:CompileOnly=Test  -cp 0004/ Test

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/shade/trunks/jdk/src/hotspot/share/opto/phaseX.cpp:1162), pid=3177918, tid=3177931
#  assert(false) failed: infinite loop in PhaseIterGVN::transform_old


Current CompileTask:
C2:    158   11    b        Test::sMeth (250 bytes)

Stack: [0x00007fab2e4b4000,0x00007fab2e5b5000],  sp=0x00007fab2e5af5a0,  free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x17b3771]  PhaseIterGVN::transform_old(Node*)+0x381
V  [libjvm.so+0x17ac69e]  PhaseIterGVN::optimize()+0x7e
V  [libjvm.so+0xb2d8aa]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x6fa
V  [libjvm.so+0xb2a3ac]  Compile::Optimize()+0x47c
V  [libjvm.so+0xb2c474]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x12a4
V  [libjvm.so+0x9426cb]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x69b
V  [libjvm.so+0xb3b708]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xac8
V  [libjvm.so+0xb3c418]  CompileBroker::compiler_thread_loop()+0x578
V  [libjvm.so+0x1055ec0]  JavaThread::thread_main_inner()+0x240
V  [libjvm.so+0x1b7a374]  Thread::call_run()+0x104
V  [libjvm.so+0x172bd3c]  thread_native_entry(Thread*)+0x10c

Bisection points to JDK-8289996.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9820 Date: 2022-08-10 09:33:58 +0000
10-08-2022

Without my patch, this assertion still fails (with lower probability). It's not introduced by my patch. I have attached a small test case to reproduce. java -Xbatch -XX:-TieredCompilation -XX:+StressIGVN Test # To suppress the following error report, specify this argument # after -XX: or in .hotspotrc: SuppressErrorAt=/phaseX.cpp:1162 # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/home/penli01/jdk_src/src/hotspot/share/opto/phaseX.cpp:1162), pid=3199330, tid=3199348 # assert(false) failed: infinite loop in PhaseIterGVN::transform_old # # JRE version: OpenJDK Runtime Environment (20.0) (fastdebug build 20-internal-adhoc.penli01.jdksrc) # Java VM: OpenJDK 64-Bit Server VM (fastdebug 20-internal-adhoc.penli01.jdksrc, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x1827484] PhaseIterGVN::transform_old(Node*)+0x374 # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /mnt/local/tmp/core.3199330) # # An error report file with more information is saved as: # /mnt/local/tmp/hs_err_pid3199330.log # # Compiler replay data is saved as: # /mnt/local/tmp/replay_pid3199330.log # # If you would like to submit a bug report, please visit: # https://bugreport.java.com/bugreport/crash.jsp #
05-08-2022

I will propose a patch to fix this next week.
05-08-2022

The change that introduced this regression will be backed out. Closing this as duplicate of the backout (JDK-8291597).
02-08-2022

ILW = Assert during C2 compilation due to infinite loop, with generated test and stress option, no workaround but disable compilation of affected method = HLM = P3
28-07-2022

[~pli], could you please have a look?
28-07-2022