JDK-8335843 : C2 hits assert(_print_inlining_stream->size() > 0) failed: missing inlining msg
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23,24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-08
  • Updated: 2024-07-29
  • Resolved: 2024-07-19
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 24
24 b08Fixed
Related Reports
Relates :  
Relates :  
Description
While testing the new -XX:+StressUnstableIfTraps option (see JDK-8335334), I hit an assert with TestDuplicatedLateInliningOutput.java added by JDK-8320237. I slightly modified the test (see attached test.patch) and can now also reproduce the issue without any stress options:

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/open/src/hotspot/share/opto/compile.cpp:4582), pid=317975, tid=317990
#  assert(_print_inlining_stream->size() > 0) failed: missing inlining msg
#
# JRE version: Java(TM) SE Runtime Environment (24.0+4) (fastdebug build 24-ea+4-328)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-ea+4-328, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x9d4336]  Compile::print_inlining_update_delayed(CallGenerator*)+0x1c6

Current CompileTask:
C2:103    7    b        compiler.inlining.TestDuplicatedLateInliningOutput$NonConstantReceiverLauncher::test (16 bytes)

Stack: [0x00007ff401638000,0x00007ff401739000],  sp=0x00007ff401734140,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x9d4336]  Compile::print_inlining_update_delayed(CallGenerator*)+0x1c6  (compile.cpp:4582)
V  [libjvm.so+0x83b675]  CallGenerator::do_late_inline_helper()+0x9a5
V  [libjvm.so+0x9da9b4]  Compile::inline_incrementally_one()+0xd4
V  [libjvm.so+0x9db288]  Compile::process_late_inline_calls_no_inline(PhaseIterGVN&)+0x78
V  [libjvm.so+0x9de404]  Compile::Optimize()+0x1024
V  [libjvm.so+0x9e1946]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b06
V  [libjvm.so+0x833955]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1d5
V  [libjvm.so+0x9ed5b8]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928
V  [libjvm.so+0x9ee248]  CompileBroker::compiler_thread_loop()+0x478
V  [libjvm.so+0xe97a1c]  JavaThread::thread_main_inner()+0xcc
V  [libjvm.so+0x17b4b76]  Thread::call_run()+0xb6
V  [libjvm.so+0x149e2d7]  thread_native_entry(Thread*)+0x127

Looks like a regression from JDK-8335334. At least, when reverting JDK-8335334 the issue does not reproduce anymore.
Comments
Changeset: 10982fe5 Branch: master Author: Roland Westrelin <roland@openjdk.org> Date: 2024-07-19 07:28:51 +0000 URL: https://git.openjdk.org/jdk/commit/10982fe557e9e8b68b674630a9979cb355bdbe62
19-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20230 Date: 2024-07-18 08:14:02 +0000
18-07-2024

[~kxu], [~roland], could you please have a look? Thanks.
08-07-2024

ILW = Assert due to missing inlining message (harmless in product), edge case with diagnostic PrintIInlining flag, no workaround = MLH = P4
08-07-2024