JDK-8320308 : C2 compilation crashes in LibraryCallKit::inline_unsafe_access
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22,23,24
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2023-11-17
  • Updated: 2024-06-11
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 23 JDK 24
23Unresolved 24Unresolved
Related Reports
Blocks :  
Description
The new -XX:+StressIncrementalInlining flag introduced by JDK-8319879 triggers the following extremely intermittent assert with java/foreign/TestByteBuffer.java and -XX:+UnlockDiagnosticVMOptions -XX:+StressIncrementalInlining:

# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb4330c539, pid=92580, tid=118028
#
# JRE version: Java(TM) SE Runtime Environment (22.0) (build 22-internal-2023-11-17-0923175.tobias.hartmann.jdk3)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (22-internal-2023-11-17-0923175.tobias.hartmann.jdk3, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0x5dc539]  LibraryCallKit::inline_unsafe_access+0x2c9
#

Current CompileTask:
C2:1693 1688       4       TestByteBuffer$$Lambda/0x000001d3110a53a8::apply (12 bytes)

Stack: [0x0000001a8a200000,0x0000001a8a300000],  sp=0x0000001a8a2fb640,  free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x5dc539]  LibraryCallKit::inline_unsafe_access+0x2c9  (library_call.cpp:2387)
V  [jvm.dll+0x5e0fff]  LibraryCallKit::try_to_inline+0x65f  (library_call.cpp:766)
V  [jvm.dll+0x5ca9d4]  LibraryIntrinsic::generate+0x94  (library_call.cpp:117)
V  [jvm.dll+0x2f5c7f]  Parse::do_call+0x53f  (doCall.cpp:675)
V  [jvm.dll+0x6f8b47]  Parse::do_one_bytecode+0x3007  (parse2.cpp:2729)
V  [jvm.dll+0x6f0e95]  Parse::do_one_block+0x175  (parse1.cpp:1578)
V  [jvm.dll+0x6f0337]  Parse::do_all_blocks+0x367  (parse1.cpp:716)
V  [jvm.dll+0x6ee50c]  Parse::Parse+0x67c  (parse1.cpp:620)
V  [jvm.dll+0x1cb7ac]  ParseGenerator::generate+0x8c  (callGenerator.cpp:100)
V  [jvm.dll+0x1cc32b]  PredictedCallGenerator::generate+0x26b  (callGenerator.cpp:921)
V  [jvm.dll+0x1c9e12]  CallGenerator::do_late_inline_helper+0x562  (callGenerator.cpp:698)
V  [jvm.dll+0x253268]  Compile::inline_incrementally_one+0xf8  (compile.cpp:2036)
V  [jvm.dll+0x252b78]  Compile::inline_incrementally+0x238  (compile.cpp:2117)
V  [jvm.dll+0x24bcdd]  Compile::Optimize+0x2ad  (compile.cpp:2254)
V  [jvm.dll+0x24a286]  Compile::Compile+0xd66  (compile.cpp:855)
V  [jvm.dll+0x1c85e0]  C2Compiler::compile_method+0x110  (c2compiler.cpp:137)
V  [jvm.dll+0x259cde]  CompileBroker::invoke_compiler_on_method+0x7ee  (compileBroker.cpp:2295)
V  [jvm.dll+0x2581ba]  CompileBroker::compiler_thread_loop+0x26a  (compileBroker.cpp:1952)
V  [jvm.dll+0x3f58d6]  JavaThread::run+0x116  (javaThread.cpp:705)
V  [jvm.dll+0x81739b]  Thread::call_run+0xcb  (thread.cpp:230)
V  [jvm.dll+0x6dcc25]  thread_native_entry+0x95  (os_windows.cpp:553)
C  [ucrtbase.dll+0x26c0c]  (no source info available)
C  [KERNEL32.DLL+0x154e0]  (no source info available)
C  [ntdll.dll+0x485b]  (no source info available)

I can only reproduce it with release builds. The problem is that alias_type->adr_type() is NULL.
Comments
ILW = Crash during C2 compilation, single test with stress flag, disable inline_unsafe_intrinsic = HLM = P3
17-11-2023