JDK-8359235 : C1 compilation fails with "assert(is_single_stack() && !is_virtual()) failed: type check"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-11
  • Updated: 2025-08-19
  • Resolved: 2025-08-13
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 26
26 b11Fixed
Related Reports
Relates :  
Relates :  
Description
java -Xcomp -XX:TieredStopAtLevel=1 -XX:CompileCommand=quiet -XX:C1MaxInlineSize=200 Test.java

Same with -XX:C1MaxTrivialSize=101

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/oracle/valhalla/open/src/hotspot/share/c1/c1_LIR.hpp:428), pid=3074287, tid=3074301
#  assert(is_single_stack() && !is_virtual()) failed: type check
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-05-22-1214417.tobias...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-05-22-1214417.tobias..., compiled mode, emulated-client, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x8a04a7]  LIR_Opr::single_stack_ix() const+0x77
#

Current CompileTask:
C1:178152 5236   !b  1       java.lang.invoke.LambdaFormEditor::putInCache (514 bytes)

Stack: [0x00007910af300000,0x00007910af400000],  sp=0x00007910af3fd7d0,  free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x8a04a7]  LIR_Opr::single_stack_ix() const+0x77  (c1_LIR.hpp:428)
V  [libjvm.so+0x88c956]  LIR_Assembler::stack2reg(LIR_Opr, LIR_Opr, BasicType)+0x136  (c1_LIRAssembler_x86.cpp:909)
V  [libjvm.so+0x8835ee]  LIR_Assembler::move_op(LIR_Opr, LIR_Opr, BasicType, LIR_PatchCode, CodeEmitInfo*, bool)+0x19e  (c1_LIRAssembler.cpp:907)
V  [libjvm.so+0x885074]  LIR_Assembler::emit_op1(LIR_Op1*)+0x404  (c1_LIRAssembler.cpp:510)
V  [libjvm.so+0x88543e]  LIR_Assembler::emit_lir_list(LIR_List*)+0xee  (c1_LIRAssembler.cpp:305)
V  [libjvm.so+0x885d5d]  LIR_Assembler::emit_code(BlockList*)+0xdd  (c1_LIRAssembler.cpp:270)
V  [libjvm.so+0x829a2b]  Compilation::emit_code_body()+0x19b  (c1_Compilation.cpp:355)
V  [libjvm.so+0x82a09b]  Compilation::compile_java_method()+0x3cb  (c1_Compilation.cpp:416)
V  [libjvm.so+0x82a9d6]  Compilation::compile_method()+0x266  (c1_Compilation.cpp:478)
V  [libjvm.so+0x82b220]  Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, bool, DirectiveSet*)+0x3e0  (c1_Compilation.cpp:614)
V  [libjvm.so+0x82cc2e]  Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x22e  (c1_Compiler.cpp:262)
V  [libjvm.so+0xb64ff8]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb58  (compileBroker.cpp:2307)
V  [libjvm.so+0xb661b8]  CompileBroker::compiler_thread_loop()+0x568  (compileBroker.cpp:1951)
V  [libjvm.so+0x10dff7b]  JavaThread::thread_main_inner()+0x13b  (javaThread.cpp:774)
V  [libjvm.so+0x1b5a146]  Thread::call_run()+0xb6  (thread.cpp:231)
V  [libjvm.so+0x17c56b8]  thread_native_entry(Thread*)+0x128  (os_linux.cpp:875)
C  [libc.so.6+0x9caa4]

Looks similar to JDK-8202565.
Comments
Changeset: f3b34d32 Branch: master Author: Guanqiang Han <ghan@openjdk.org> Committer: Tobias Hartmann <thartmann@openjdk.org> Date: 2025-08-13 10:52:54 +0000 URL: https://git.openjdk.org/jdk/commit/f3b34d32d6ea409f8c8f0382e8f01e746366f842
13-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26462 Date: 2025-07-24 15:10:37 +0000
24-07-2025

Didn't manage to reproduce before JDK-8251462 but the issue most likely affects earlier versions as well. ILW = Assert during C1 compilation, single test with C1 and large max inlining size, disable compilation of affected method = HLM = P3
13-06-2025

Bisection points to JDK-8251462 in JDK 17 b08 but that probably just triggered it.
12-06-2025