JDK-8268017 : C2: assert(phi_type->isa_int() || phi_type->isa_ptr() || phi_type->isa_long()) failed: bad phi type
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-06-01
  • Updated: 2021-07-06
  • Resolved: 2021-06-09
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 17
17 b26Fixed
Related Reports
Relates :  
Description
The attached fuzzer test fails intermittently with the following assertion:

To reproduce (fails 1 out of 3-4 runs):
$ java -XX:RepeatCompilation=100 Test.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S79226/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/0cb697b6-5006-4d18-afca-8f82d7082f5e/runs/5d51f3ad-e036-4803-805d-9e13517ddb05/workspace/open/src/hotspot/share/opto/cfgnode.cpp:1972), pid=14706, tid=14725
#  assert(phi_type->isa_int() || phi_type->isa_ptr() || phi_type->isa_long()) failed: bad phi type
#
# JRE version: Java(TM) SE Runtime Environment (17.0+25) (fastdebug build 17-ea+25-LTS-2214)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+25-LTS-2214, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x893a5a]  PhiNode::Ideal(PhaseGVN*, bool)+0xfaa
.............
Command Line: -XX:RepeatCompilation=100 --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
.............
Current thread (0x00007f2e1c1acb40):  JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=14725, stack(0x00007f2e499f9000,0x00007f2e49afa000)]


Current CompileTask:
C2:  12185  699 % !   4       Test::mainTest @ 261 (642 bytes)

Stack: [0x00007f2e499f9000,0x00007f2e49afa000],  sp=0x00007f2e49af4830,  free space=1006k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x893a5a]  PhiNode::Ideal(PhaseGVN*, bool)+0xfaa
V  [libjvm.so+0x15fd5d8]  PhaseIterGVN::transform_old(Node*)+0xb8
V  [libjvm.so+0x15f63ae]  PhaseIterGVN::optimize()+0x7e
V  [libjvm.so+0xa1ddea]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x69a
V  [libjvm.so+0xa1a1dc]  Compile::Optimize()+0x12ec
V  [libjvm.so+0xa1bec5]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1585
V  [libjvm.so+0x841aba]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
V  [libjvm.so+0xa2c889]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xfb9
V  [libjvm.so+0xa2d5f8]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18a3a11]  JavaThread::thread_main_inner()+0x271
V  [libjvm.so+0x18ab610]  Thread::call_run()+0x100
V  [libjvm.so+0x157721e]  thread_native_entry(Thread*)+0x10e
Comments
Changeset: 4413142e Author: Roland Westrelin <roland@openjdk.org> Date: 2021-06-09 07:58:17 +0000 URL: https://git.openjdk.java.net/jdk/commit/4413142eca1712f9a78c5683083eb01908397bb0
09-06-2021

Found another Java Fuzzer failure (Test2.java) which reproduces reliably: $ java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test2 Test2.java Could trace it back to JDK-8252372. Bumping priority up to P2 as it was introduced recently and should be fixed in JDK 17. [~roland] can you take a look at it?
07-06-2021

ILW = C2 assertion in Ideal transformation, only fails intermittently with single Java Fuzzer test, disable compilation of affected method = HLM = P3
01-06-2021

Could not reproduce this with JDK 16 or JDK 11u.
01-06-2021