JDK-8260284 : C2: assert(_base == Int) failed: Not an Int
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,16,17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-01-22
  • Updated: 2022-03-22
  • Resolved: 2021-01-25
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 11 JDK 16 JDK 17
11.0.12-oracleFixed 16 b34Fixed 17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The attached fuzzer test fails with the following assertion:

To reproduce:
# java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test Test.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/983c483a-6907-44e0-ad29-98c7183575e2-S14469/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/5986f74f-93ba-4d44-baaf-79d9af86790f/runs/ec853337-5fd8-4ef2-b3ea-1559f628e816/workspace/open/src/hotspot/share/opto/type.hpp:1613), pid=31055, tid=31068
#  assert(_base == Int) failed: Not an Int
#
# JRE version: Java(TM) SE Runtime Environment (16.0+32) (fastdebug build 16-ea+32-2190)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-ea+32-2190, compiled mode, sharing, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1621164]  PhaseIterGVN::no_dependent_zero_check(Node*) const+0x144
...........
Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
...........
Current thread (0x00007f6164495ac0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=31068, stack(0x00007f6154043000,0x00007f6154144000)]


Current CompileTask:
C2:    329    5   !b        Test::iMeth (323 bytes)

Stack: [0x00007f6154043000,0x00007f6154144000],  sp=0x00007f615413f3d0,  free space=1008k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1621164]  PhaseIterGVN::no_dependent_zero_check(Node*) const+0x144
V  [libjvm.so+0xe045fb]  IfNode::dominated_by(Node*, PhaseIterGVN*)+0x37b
V  [libjvm.so+0x16255bd]  PhaseIterGVN::transform_old(Node*)+0xed
V  [libjvm.so+0x161ddbe]  PhaseIterGVN::optimize()+0x7e
V  [libjvm.so+0xa168e6]  Compile::Optimize()+0x216
V  [libjvm.so+0xa19988]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1838
V  [libjvm.so+0x849aec]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1dc
V  [libjvm.so+0xa29798]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xe88
V  [libjvm.so+0xa2a3e8]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18ba936]  JavaThread::thread_main_inner()+0x256
V  [libjvm.so+0x18c12b0]  Thread::call_run()+0x100
V  [libjvm.so+0x15a3486]  thread_native_entry(Thread*)+0x116
Comments
Fix Request (11u) Should get backported for parity with 11.0.12-oracle (follow-up fix for JDK-8257822). This one applies cleanly.
19-03-2021

verified w/ test/hotspot/jtreg/compiler/loopopts/TestDivWithTopDivisor.java
28-01-2021

Changeset: c5ab7c32 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-01-25 17:09:52 +0000 URL: https://git.openjdk.java.net/jdk16/commit/c5ab7c32
25-01-2021

Fix request for JDK 16 approved.
22-01-2021

Fix Request: This bug is an edge case found by fuzzing that is not handled correctly in code recently introduced in JDK 16 with JDK-8257822. It results in a crash in a debug VM. In a product VM, we read random memory which could result in a crash. The risk of this fix is low as it just handles the missing edge case. Testing: Failing test case and Tier1-4, hs-precheckin-comp. Reviewed (yet) by Tobias.
22-01-2021

ILW = Assert during C2 compilation (potential crash in product, regression in JDK 16), reproducible with Fuzzer generated test, disable compilation of affected method = HMM = P2
22-01-2021