JDK-8249602 : C2: assert(cnt == _outcnt) failed: no insertions allowed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,14,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-16
  • Updated: 2020-09-24
  • Resolved: 2020-07-28
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
11.0.10-oracleFixed 16 b08Fixed
Description
The attached fuzzer test fails intermittently with the following assertion.

To reproduce:
$ java Test.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/christian/jdk/open/src/hotspot/share/opto/node.cpp:214), pid=19747, tid=19759
#  assert(cnt == _outcnt) failed: no insertions allowed
#
# JRE version: Java(TM) SE Runtime Environment (16.0) (slowdebug build 16-internal+0-2020-07-13-1111353.christian...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 16-internal+0-2020-07-13-1111353.christian..., mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xe5a558]  DUIterator_Fast::verify(Node const*, bool)+0x58
..........
Command Line: --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
..........
Current thread (0x00007f75f03537e0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=19759, stack(0x00007f75d80b4000,0x00007f75d81b5000)]


Current CompileTask:
C2:   8010 1788       4       Test::iMeth (221 bytes)

Stack: [0x00007f75d80b4000,0x00007f75d81b5000],  sp=0x00007f75d81af050,  free space=1004k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xe5a558]  DUIterator_Fast::verify(Node const*, bool)+0x58
V  [libjvm.so+0x5e059e]  DUIterator_Fast::operator++(int)+0x4a
V  [libjvm.so+0xd00760]  PhaseIdealLoop::insert_post_loop(IdealLoopTree*, Node_List&, CountedLoopNode*, CountedLoopEndNode*, Node*, Node*, CountedLoopNode*&)+0x864
V  [libjvm.so+0xcfebd8]  PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree*, Node_List&, bool)+0x39a
V  [libjvm.so+0xd07582]  IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x388
V  [libjvm.so+0xd07817]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x10b
V  [libjvm.so+0xd07748]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x3c
V  [libjvm.so+0xd07748]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x3c
V  [libjvm.so+0xd078b5]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd078b5]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd1aae4]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x1470
V  [libjvm.so+0x6e1dfb]  PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&, LoopOptsMode)+0xb3
V  [libjvm.so+0x6e1ef6]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x46
V  [libjvm.so+0x6d64ff]  Compile::Optimize()+0x907
V  [libjvm.so+0x6cfaca]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1090
V  [libjvm.so+0x5ce7a7]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x15b
V  [libjvm.so+0x6ea926]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x88e
V  [libjvm.so+0x6e95b3]  CompileBroker::compiler_thread_loop()+0x3df
V  [libjvm.so+0x10a0bdf]  compiler_thread_entry(JavaThread*, Thread*)+0x69
V  [libjvm.so+0x109bd90]  JavaThread::thread_main_inner()+0x146
V  [libjvm.so+0x109bc41]  JavaThread::run()+0x11f
V  [libjvm.so+0x1097eca]  Thread::call_run()+0x180
V  [libjvm.so+0xea6716]  thread_native_entry(Thread*)+0x1e4
Comments
Fix request (11u) I would like to downport this for parity with 11.0.10-oracle. I had to resolve some trivial conflicts: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-September/003846.html
22-09-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/b7dda1eda100 User: chagedorn Date: 2020-07-28 15:09:40 +0000
28-07-2020