JDK-8297345 : C2: SIGSEGV in PhaseIdealLoop::push_pinned_nodes_thru_region
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2022-11-21
  • Updated: 2022-12-15
  • Resolved: 2022-12-01
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
20Resolved
Related Reports
Cloners :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Triggered by java/util/Collections/RacingCollections.java, for now only on macosx-aarch64

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000103db75d0, pid=40270, tid=36147
#
# JRE version: Java(TM) SE Runtime Environment (20.0+25) (build 20-ea+25-1870)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20-ea+25-1870, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# V  [libjvm.dylib+0x70b5d0]  _ZN14PhaseIdealLoop29push_pinned_nodes_thru_regionEP6IfNodeP4Node+0x1c


Current CompileTask:
C2:  19565 3884       4       RacingCollections$Frobber::realRun (680 bytes)

Stack: [0x0000000172078000,0x000000017227b000],  sp=0x0000000172276ab0,  free space=2042k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x70b5d0]  _ZN14PhaseIdealLoop29push_pinned_nodes_thru_regionEP6IfNodeP4Node+0x1c
V  [libjvm.dylib+0x70a9e0]  _ZN14PhaseIdealLoop23try_merge_identical_ifsEP4Node+0xf4
V  [libjvm.dylib+0x709e50]  _ZN14PhaseIdealLoop25split_if_with_blocks_postEP4Node+0x78
V  [libjvm.dylib+0x70c000]  _ZN14PhaseIdealLoop20split_if_with_blocksER9VectorSetR10Node_Stack+0x11c
V  [libjvm.dylib+0x6fe974]  _ZN14PhaseIdealLoop18build_and_optimizeEv+0x868
V  [libjvm.dylib+0x2a14b8]  _ZN14PhaseIdealLoop8optimizeER12PhaseIterGVN12LoopOptsMode+0x10c
V  [libjvm.dylib+0x2a171c]  _ZN7Compile14optimize_loopsER12PhaseIterGVN12LoopOptsMode+0xb0
V  [libjvm.dylib+0x29dc7c]  _ZN7Compile8OptimizeEv+0xeec
V  [libjvm.dylib+0x29bfe4]  _ZN7CompileC2EP5ciEnvP8ciMethodi7OptionsP12DirectiveSet+0xaa0
V  [libjvm.dylib+0x1fb224]  _ZN10C2Compiler14compile_methodEP5ciEnvP8ciMethodibP12DirectiveSet+0x134
V  [libjvm.dylib+0x2ad764]  _ZN13CompileBroker25invoke_compiler_on_methodEP11CompileTask+0x3d0
V  [libjvm.dylib+0x2ad318]  _ZN13CompileBroker20compiler_thread_loopEv+0x484
V  [libjvm.dylib+0x4b9014]  _ZN10JavaThread17thread_main_innerEv+0x8c
V  [libjvm.dylib+0x941c1c]  _ZN6Thread8call_runEv+0xc8
V  [libjvm.dylib+0x7f4d04]  _ZL19thread_native_entryP6Thread+0x158
C  [libsystem_pthread.dylib+0x726c]  _pthread_start+0x94

Comments
I tried to reproduce this locally using the replay compilation file from a linux-x64 failure, unfortunately without success. Please find the replay compilation file (replay_pid2002869.log) and driver script (replay.sh). Note that there are a few remaining replay warnings and errors that are currently just ignored: java.lang.NoClassDefFoundError: jdk/internal/vm/PostVMInitHook$1 java.lang.NoClassDefFoundError: jdk/internal/vm/PostVMInitHook java.lang.NoClassDefFoundError: jdk/internal/module/SystemModules$default Warning: entry was unresolved in the replay data: java/lang/LinkageError Resolving klass java/util/Collections$SynchronizedList at 2 Error while parsing line 2228 at position 207: tag mismatch: wrong class files? Warning: requesting ciMethod record for method with no data: virtual jboolean java.util.concurrent.locks.ReentrantLock$NonfairSync.tryAcquire(jint)
28-11-2022

I filed JDK-8297588 for the independent timeout issues we are seeing during error reporting.
24-11-2022

This can be reproduced more or less reliably by running full open/test/jdk/:tier1_part2 in a loop (reproduces in 1/100).
24-11-2022

This is likely a regression from JDK-6312651 but I was not able to prove that yet. EDIT: [~roland], I now executed enough runs prove that this is a regression from JDK-6312651. The issues reproduces with jdk-20+25-1866 but not with jdk-20+25-1865 and there is no other change in-between.
24-11-2022

I verified that the issue is a NULL 'region' argument to push_pinned_nodes_thru_region.
24-11-2022

My hypothesis is that the region argument of push_pinned_nodes_thru_region is NULL but I was not able to prove that yet. That would mean that just called PhaseIdealLoop::do_split_if returned NULL for new_false_region or new_true_region which can only happen if there's an IfNode with only one output projection. [~roland] any ideas?
23-11-2022

PhaseIdealLoop::push_pinned_nodes_thru_region+0x1c is in Node::has_out: (lldb) image lookup -v --address 0x0000000102e7313c+0x1c Address: libjvm.dylib[0x000000000070b158] (libjvm.dylib.__TEXT.__text + 7368216) Summary: libjvm.dylib`PhaseIdealLoop::push_pinned_nodes_thru_region(IfNode*, Node*) + 28 [inlined] Node::has_out(unsigned int) const at node.hpp:366:49 libjvm.dylib`PhaseIdealLoop::push_pinned_nodes_thru_region(IfNode*, Node*) + 28 at loopopts.cpp:1523:47
23-11-2022

Seems to be very intermittent, I was not able to reproduce this yet.
21-11-2022

ILW = Crash during compilation, with single test at tier1, disable split if or compilation of affected method = HMM = P2
21-11-2022