JDK-8298353 : C2 fails with assert(opaq->outcnt() == 1 && opaq->in(1) == limit) failed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20,21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-12-08
  • Updated: 2022-12-12
  • Resolved: 2022-12-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 20 JDK 21
20 masterFixed 21Fixed
Related Reports
Relates :  
Description
Happened once with test/langtools/tools/javac/MethodParameters/LegacyOutputTest/LegacyOutputTest.java and several times with an internal test suite.

# Internal Error (/workspace/open/src/hotspot/share/opto/loopTransform.cpp:2228), pid=781540, tid=787403
# Error: assert(opaq->outcnt() == 1 && opaq->in(1) == limit) failed
#
# JRE version: Java(TM) SE Runtime Environment (20.0) (fastdebug build 20-internal-2022-12-07-2029099.coleen.phillimore.jdk-ks)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-internal-2022-12-07-2029099.coleen.phillimore.jdk-ks, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# V [libjvm.so+0x12a6000] PhaseIdealLoop::do_unroll(IdealLoopTree*, Node_List&, bool)+0x230

Stack: [0x0000fffd3e200000,0x0000fffd3e400000], sp=0x0000fffd3e3f99d0, free space=2022k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x12a6000] PhaseIdealLoop::do_unroll(IdealLoopTree*, Node_List&, bool)+0x230 (loopTransform.cpp:2228)
V [libjvm.so+0x12b0100] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x530 (loopTransform.cpp:3870)
V [libjvm.so+0x12b02e8] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x108 (loopTransform.cpp:3906)
V [libjvm.so+0x12b022c] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x4c (loopTransform.cpp:3890)
V [libjvm.so+0x12dd958] PhaseIdealLoop::build_and_optimize()+0xc64 (loopnode.cpp:4543)
V [libjvm.so+0x9a6e00] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1e0 (loopnode.hpp:1082)
V [libjvm.so+0x9a29a8] Compile::Optimize()+0xde8 (compile.cpp:2146)
V [libjvm.so+0x9a527c] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x11cc (compile.cpp:830)
V [libjvm.so+0x7c4578] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1b4 (c2compiler.cpp:113)
V [libjvm.so+0x9b1ac4] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa10 (compileBroker.cpp:2237)
V [libjvm.so+0x9b2528] CompileBroker::compiler_thread_loop()+0x5b8 (compileBroker.cpp:1916)
V [libjvm.so+0xed2350] JavaThread::thread_main_inner()+0x21c (javaThread.cpp:709)
V [libjvm.so+0x17d6548] Thread::call_run()+0xf8 (thread.cpp:224)
V [libjvm.so+0x14eed44] thread_native_entry(Thread*)+0x100 (os_linux.cpp:739)
C [libpthread.so.0+0x7908] start_thread+0x188
Comments
The fix for this bug was synced into jdk/jdk in jdk-21+2-23.
11-12-2022

This fix is integrated in jdk-20+28-2217. The fix has not yet been sync'ed to jdk-21.
09-12-2022

Here's the failing thread's stack trace from the jdk-21+1-2-tier5 CI sighting: applications/renaissance/RenaissanceStressTest.java --------------- T H R E A D --------------- Current thread (0x0000fffb6db0e2b0): JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=1984452, stack(0x0000fffb7ec00000,0x0000fffb7ee00000)] Current CompileTask: C2: 905821 59163 4 jdk.nio.zipfs.ZipFileSystem::makeParentDirs (141 bytes) Stack: [0x0000fffb7ec00000,0x0000fffb7ee00000], sp=0x0000fffb7edf99d0, free space=2022k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x12a7710] PhaseIdealLoop::do_unroll(IdealLoopTree*, Node_List&, bool)+0x230 (loopTransform.cpp:2228) V [libjvm.so+0x12b1810] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x530 (loopTransform.cpp:3870) V [libjvm.so+0x12b19f8] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x108 (loopTransform.cpp:3906) V [libjvm.so+0x12b193c] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x4c (loopTransform.cpp:3890) V [libjvm.so+0x12defb8] PhaseIdealLoop::build_and_optimize()+0xc64 (loopnode.cpp:4538) V [libjvm.so+0x9a7660] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1e0 (loopnode.hpp:1082) V [libjvm.so+0x9a3208] Compile::Optimize()+0xde8 (compile.cpp:2146) V [libjvm.so+0x9a5adc] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x11cc (compile.cpp:830) V [libjvm.so+0x7c4c38] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1b4 (c2compiler.cpp:113) V [libjvm.so+0x9b2324] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa10 (compileBroker.cpp:2237) V [libjvm.so+0x9b2d88] CompileBroker::compiler_thread_loop()+0x5b8 (compileBroker.cpp:1916) V [libjvm.so+0xed2990] JavaThread::thread_main_inner()+0x21c (javaThread.cpp:709) V [libjvm.so+0x17d8118] Thread::call_run()+0xf8 (thread.cpp:224) V [libjvm.so+0x14f0914] thread_native_entry(Thread*)+0x100 (os_linux.cpp:739) C [libpthread.so.0+0x7908] start_thread+0x188
09-12-2022

Changeset: b7b996cb Author: Roland Westrelin <roland@openjdk.org> Date: 2022-12-09 15:33:09 +0000 URL: https://git.openjdk.org/jdk20/commit/b7b996cb9475f8191d4085a2f7f68187b6f015d5
09-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20/pull/6 Date: 2022-12-09 08:43:20 +0000
09-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11596 Date: 2022-12-08 16:04:16 +0000
08-12-2022

Here's the crashing thread's stack for the jdk-20+27-2189-tier5 sighting: applications/renaissance/RenaissanceStressTest.java --------------- T H R E A D --------------- Current thread (0x0000fffe8c2fc4f0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=3425845, stack(0x0000fffe5adc0000,0x0000fffe5afc0000)] Current CompileTask: C2: 904578 55475 4 jdk.nio.zipfs.ZipFileSystem::makeParentDirs (141 bytes) Stack: [0x0000fffe5adc0000,0x0000fffe5afc0000], sp=0x0000fffe5afb99d0, free space=2022k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x12a7260] PhaseIdealLoop::do_unroll(IdealLoopTree*, Node_List&, bool)+0x230 (loopTransform.cpp:2228) V [libjvm.so+0x12b1360] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x530 (loopTransform.cpp:3870) V [libjvm.so+0x12b1548] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x108 (loopTransform.cpp:3906) V [libjvm.so+0x12b148c] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x4c (loopTransform.cpp:3890) V [libjvm.so+0x12debb8] PhaseIdealLoop::build_and_optimize()+0xc64 (loopnode.cpp:4543) V [libjvm.so+0x9a7020] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1e0 (loopnode.hpp:1082) V [libjvm.so+0x9a2bc8] Compile::Optimize()+0xde8 (compile.cpp:2146) V [libjvm.so+0x9a549c] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x11cc (compile.cpp:830) V [libjvm.so+0x7c4618] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1b4 (c2compiler.cpp:113) V [libjvm.so+0x9b1ce4] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa10 (compileBroker.cpp:2237) V [libjvm.so+0x9b2748] CompileBroker::compiler_thread_loop()+0x5b8 (compileBroker.cpp:1916) V [libjvm.so+0xed23f0] JavaThread::thread_main_inner()+0x21c (javaThread.cpp:709) V [libjvm.so+0x17d78a8] Thread::call_run()+0xf8 (thread.cpp:224) V [libjvm.so+0x14f00a4] thread_native_entry(Thread*)+0x100 (os_linux.cpp:739) C [libpthread.so.0+0x7908] start_thread+0x188
08-12-2022

Though the failure is similar to JDK-8294540, looking at the failure history, I think this is likely a regression from JDK-8269820.
08-12-2022

ILW = Assert during C2 compilation, intermittent on aarch64 only so far, no workaround = MMH = P3
08-12-2022