JDK-8253644 : C2: assert(skeleton_predicate_has_opaque(iff)) failed: unexpected
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,15,16
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2020-09-25
  • Updated: 2024-06-19
  • Resolved: 2020-12-08
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.11-oracleFixed 16 b28Fixed
Related Reports
Relates :  
Relates :  
Description
The attached fuzzer test fails with the following assertion.

To reproduce:
$ java -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test Test.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/christian/jdk/open/src/hotspot/share/opto/loopTransform.cpp:1263), pid=23631, tid=23643
#  assert(skeleton_predicate_has_opaque(iff)) failed: unexpected
#
# JRE version: Java(TM) SE Runtime Environment (16.0) (slowdebug build 16-internal+0-2020-09-25-1122319.christian...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 16-internal+0-2020-09-25-1122319.christian..., compiled mode, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xd143f5]  PhaseIdealLoop::copy_skeleton_predicates_to_main_loop_helper(Node*, Node*, Node*, IdealLoopTree*, LoopNode*, unsigned int, unsigned int, unsigned int, Node*, Node*, Node_List const&)+0x3b5
..........
Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
..........
Current thread (0x00007fc5bc335fa0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=23643, stack(0x00007fc59f1cd000,0x00007fc59f2ce000)]


Current CompileTask:
C2:   9432   90   !b        Test::mainTest (512 bytes)

Stack: [0x00007fc59f1cd000,0x00007fc59f2ce000],  sp=0x00007fc59f2c7d30,  free space=1003k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xd143f5]  PhaseIdealLoop::copy_skeleton_predicates_to_main_loop_helper(Node*, Node*, Node*, IdealLoopTree*, LoopNode*, unsigned int, unsigned int, unsigned int, Node*, Node*, Node_List const&)+0x3b5
V  [libjvm.so+0xd15145]  PhaseIdealLoop::copy_skeleton_predicates_to_main_loop(CountedLoopNode*, Node*, Node*, IdealLoopTree*, LoopNode*, unsigned int, unsigned int, unsigned int, Node*, Node*, Node_List const&)+0x107
V  [libjvm.so+0xd15e3c]  PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree*, Node_List&, bool)+0xcb6
V  [libjvm.so+0xd1dd6c]  IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x388
V  [libjvm.so+0xd1e001]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x10b
V  [libjvm.so+0xd1e09f]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd1df32]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x3c
V  [libjvm.so+0xd1e09f]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd1e09f]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd1e09f]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd1e09f]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V  [libjvm.so+0xd3138e]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x1470
V  [libjvm.so+0x6f8aa7]  PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&, LoopOptsMode)+0xb3
V  [libjvm.so+0x6f8ba2]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x46
V  [libjvm.so+0x6ec785]  Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0xf7
V  [libjvm.so+0x6ed533]  Compile::Optimize()+0xc0b
V  [libjvm.so+0x6e67d8]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1090
V  [libjvm.so+0x5e12a9]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x15b
V  [libjvm.so+0x701859]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x895
V  [libjvm.so+0x7004df]  CompileBroker::compiler_thread_loop()+0x3df
V  [libjvm.so+0x10c508f]  compiler_thread_entry(JavaThread*, Thread*)+0x69
V  [libjvm.so+0x10c035a]  JavaThread::thread_main_inner()+0x14c
V  [libjvm.so+0x10c0206]  JavaThread::run()+0x118
V  [libjvm.so+0x10bc35a]  Thread::call_run()+0x180
V  [libjvm.so+0xec5db6]  thread_native_entry(Thread*)+0x1e4
Comments
Fix Request (OpenJDK 11u): Please approve backporting this to OpenJDK 11u. The issue is present there too. Patch applies clean. It's not clear when it was introduced, but the regression test fails prior and passes after for a fastdebug build. JDK-8240227 and its parent doesn't seem to have the issue so it seems to have been introduced later for OpenJDK 11u. Either way, Oracle backported it and it seems a needed fix for OpenJDK 11u too. Testing with added regression test (fails prior with the said assert) and passes after. Part of the the tier1 test set which passes too.
13-01-2021

Changeset: 1d0adbb8 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2020-12-08 08:48:58 +0000 URL: https://git.openjdk.java.net/jdk/commit/1d0adbb8
08-12-2020

ILW = Assert during C2 compilation, regression in JDK 15 but only ever reproduced with fuzzer generated test, disable compilation of affected method = HMM = P2
28-09-2020

Starts to fail after JDK-8240227. Might be a corner case that we missed.
28-09-2020