JDK-8345250 : [lworld] C2: SIGSEGV in TypeAryPtr::flat_log_elem_size()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-11-29
  • Updated: 2024-11-29
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
repo-valhallaUnresolved
Description
The attached test crashes with a segfault in TypeAryPtr::flat_log_elem_size().

To reproduce:
$ java --enable-preview --source 24 --add-exports java.base/jdk.internal.value=ALL-UNNAMED --add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED Test.java  && jfval --enable-preview --add-exports java.base/jdk.internal.value=ALL-UNNAMED --add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED -Xcomp -XX:CompileOnly=Test*::test* Test

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007694fe515750, pid=576208, tid=576222
#
# JRE version: Java(TM) SE Runtime Environment (24.0+1) (fastdebug build 24-valhalla+1-31)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-valhalla+1-31, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1915750]  TypeAryPtr::flat_log_elem_size() const+0x50
............
Command Line: --enable-preview --add-exports=java.base/jdk.internal.value=ALL-UNNAMED --add-exports=java.base/jdk.internal.vm.annotation=ALL-UNNAMED -Xcomp -XX:CompileOnly=Test*::test* Test
.............
C2:160   64    b  4       Test::test (24 bytes)

Stack: [0x000075deaca00000,0x000075deacb00000],  sp=0x000075deacafc390,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1915750]  TypeAryPtr::flat_log_elem_size() const+0x50
V  [libjvm.so+0xe3d968]  GraphKit::array_element_address(Node*, Node*, BasicType, TypeInt const*, Node*)+0x78
V  [libjvm.so+0x15fe305]  Parse::array_addressing(BasicType, int, Type const*&)+0x395
V  [libjvm.so+0x15fea3f]  Parse::array_load(BasicType)+0x3f
V  [libjvm.so+0x160f08e]  Parse::do_one_bytecode()+0x74e
V  [libjvm.so+0x15f52aa]  Parse::do_one_block()+0x20a
V  [libjvm.so+0x15f6766]  Parse::do_all_blocks()+0x136
V  [libjvm.so+0x15fa4a2]  Parse::Parse(JVMState*, ciMethod*, float)+0xe52
V  [libjvm.so+0x8b238c]  ParseGenerator::generate(JVMState*)+0x16c
V  [libjvm.so+0xa7a861]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1841
V  [libjvm.so+0x8af952]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1f2
V  [libjvm.so+0xa86868]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928
V  [libjvm.so+0xa874d8]  CompileBroker::compiler_thread_loop()+0x458
V  [libjvm.so+0xf8107c]  JavaThread::thread_main_inner()+0xcc
V  [libjvm.so+0x18e8256]  Thread::call_run()+0xb6
V  [libjvm.so+0x15a9937]  thread_native_entry(Thread*)+0x127