JDK-8297556 : Parse::check_interpreter_type fails with assert "must constrain OSR typestate"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P2
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-11-24
  • Updated: 2022-11-24
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
20Unresolved
Related Reports
Duplicate :  
Relates :  
Description
This reproduces reliably with an internal test:

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (workspace/open/src/hotspot/share/opto/parse1.cpp:180), pid=791450, tid=791463
#  assert(_gvn.type(l)->higher_equal(type)) failed: must constrain OSR typestate
#
# JRE version: Java(TM) SE Runtime Environment (20.0+25) (fastdebug build 20-ea+25-1866)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+25-1866, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x175019c]  Parse::check_interpreter_type(Node*, Type const*, SafePointNode*&)+0x56c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp

Current CompileTask:
C2:    127   26 % !b  4       XXXX @ 38 (94 bytes)

Stack: [0x00007f1a9b537000,0x00007f1a9b638000],  sp=0x00007f1a9b634900,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x175019c]  Parse::check_interpreter_type(Node*, Type const*, SafePointNode*&)+0x56c  (parse1.cpp:180)
V  [libjvm.so+0x1755fc4]  Parse::load_interpreter_state(Node*)+0xfa4
V  [libjvm.so+0x1760e72]  Parse::Parse(JVMState*, ciMethod*, float)+0x5a2
V  [libjvm.so+0x90e730]  ParseGenerator::generate(JVMState*)+0x110
V  [libjvm.so+0xafaf4d]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x168d
V  [libjvm.so+0x90c2e7]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4e7
V  [libjvm.so+0xb0865c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa7c
V  [libjvm.so+0xb09468]  CompileBroker::compiler_thread_loop()+0x608
V  [libjvm.so+0x107ba06]  JavaThread::thread_main_inner()+0x206
V  [libjvm.so+0x1a7a9a0]  Thread::call_run()+0x100
V  [libjvm.so+0x1711c53]  thread_native_entry(Thread*)+0x103

(rr) p l->dump(1)
  64  ConP  === 0  [[ 65 63 84 83 ]]  #NULL
  99  CheckCastPP  === 97 89  [[ 83 ]]  #narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact * !jvms: XXXX @ bci:38 (line 59)
  82  Region  === 82 97 87  [[ 82 83 18 ]]  !jvms: XXXX @ bci:38 (line 59)
  83  Phi  === 82 99 64  [[ ]]  #narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact * !jvms: XXXX @ bci:38 (line 59)

(rr) p type->dump_on(tty)
narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *$4 = void

(rr) p _gvn.type(l)->dump_on(tty)
narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *$6 = void
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11356 Date: 2022-11-24 15:20:27 +0000
24-11-2022

ILW = Assert during C2 OSR compilation, reproducible with simple test, no known workaround but disable compilation of affected method = HMM = P2
24-11-2022

Roland, please have a look.
24-11-2022

I attached a simple reproducer: java -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,Test::test Test.java
24-11-2022

This is a regression from JDK-6312651.
24-11-2022