JDK-8319308 : C2 compilation asserts with "parsing found no loops but there are some"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,21,22
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-11-02
  • Updated: 2024-02-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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Applying attached patch that always enables _jvmti_can_hotswap_or_post_breakpoint , _jvmti_can_access_local_variables and _jvmti_can_post_on_exceptions leads to the following failures when running compiler/parsing/TestMissingSafepointOnTryCatch.java:

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/loopnode.cpp:4353), pid=3903733, tid=3903750
#  assert(_ltree_root->_child == nullptr || C->has_loops() || only_has_infinite_loops() || C->has_exception_backedge()) failed: parsing found no loops but there are some
#
# JRE version: Java(TM) SE Runtime Environment (22.0) (fastdebug build 22-internal-2023-11-02-0844398.tobias.hartmann.jdk3)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-internal-2023-11-02-0844398.tobias.hartmann.jdk3, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x12aee13]  PhaseIdealLoop::build_and_optimize()+0x1253

Current CompileTask:
C2:115   12   !b        MissingSafepointOnTryCatch::test1 (5 bytes)

Stack: [0x00007fc3f00a3000,0x00007fc3f01a3000],  sp=0x00007fc3f019ddf0,  free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x12aee13]  PhaseIdealLoop::build_and_optimize()+0x1253  (loopnode.cpp:4353)
V  [libjvm.so+0x9fea8b]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3ab  (loopnode.hpp:1112)
V  [libjvm.so+0x9f8d12]  Compile::Optimize()+0x5a2  (compile.cpp:2372)
V  [libjvm.so+0x9fd0e1]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b41  (compile.cpp:856)
V  [libjvm.so+0x849907]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x207  (c2compiler.cpp:134)
V  [libjvm.so+0xa09240]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x980  (compileBroker.cpp:2292)
V  [libjvm.so+0xa09fd8]  CompileBroker::compiler_thread_loop()+0x508  (compileBroker.cpp:1951)
V  [libjvm.so+0xec593c]  JavaThread::thread_main_inner()+0xcc  (javaThread.cpp:720)
V  [libjvm.so+0x17a441a]  Thread::call_run()+0xba  (thread.cpp:220)
V  [libjvm.so+0x14aa34a]  thread_native_entry(Thread*)+0x12a  (os_linux.cpp:785)
Comments
Can even be reproduced with jdk11: jtreg -jdk jdk -vmoption:-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java
06-12-2023

Assert was added by JDK-8253923. Test is from JDK-8313626. A similar issue was recently fixed by JDK-8297642.
02-11-2023

ILW = Same as JDK-8297642 = P4
02-11-2023