JDK-8273115 : CountedLoopEndNode::stride_con crash in debug build with -XX:+TraceLoopOpts
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-08-30
  • Updated: 2022-06-21
  • Resolved: 2022-04-25
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 17 JDK 19
17.0.5-oracleFixed 19 b20Fixed
Related Reports
Duplicate :  
Relates :  
Description
This crash happens for compiler.loopopts.TestMainNeverExecuted.java and compiler.c2.TestCMoveHasTopInput.java with -XX:+TraceLoopOpts. 

CountedLoopEnd's incr node expected be AddI, but is ConI, this causes crash when printing counted loop info with -XX:+TraceLoopOpts.

#  SIGSEGV (0xb) at pc=0x00002abc249ab2b8, pid=8589, tid=8606
#
# JRE version: OpenJDK Runtime Environment (18.0) (fastdebug build 18-internal+0-adhoc.shihui.jdkmaster)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 18-internal+0-adhoc.shihui.jdkmaster, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x11412b8]  CountedLoopNode::stride_con() const+0x98
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

Current CompileTask:
C2:    193    3    b        TestMainNeverExecuted::vMeth (106 bytes)

Stack: [0x00002abc3be06000,0x00002abc3bf07000],  sp=0x00002abc3bf01280,  free space=1004k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x11412b8]  CountedLoopNode::stride_con() const+0x98
V  [libjvm.so+0x1146c4e]  IdealLoopTree::dump_head() const+0x3be
V  [libjvm.so+0x1146e04]  IdealLoopTree::dump() const+0x14
V  [libjvm.so+0x1146e25]  IdealLoopTree::dump() const+0x35
V  [libjvm.so+0x1146e25]  IdealLoopTree::dump() const+0x35
V  [libjvm.so+0x11580b9]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x9e9
V  [libjvm.so+0x935734]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x1b4
V  [libjvm.so+0x932e06]  Compile::Optimize()+0xfe6
V  [libjvm.so+0x9343ae]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x132e
V  [libjvm.so+0x7875cd]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x12d
V  [libjvm.so+0x941e96]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc56
V  [libjvm.so+0x9429b8]  CompileBroker::compiler_thread_loop()+0x468
V  [libjvm.so+0x178ccd7]  JavaThread::thread_main_inner()+0x2e7
V  [libjvm.so+0x178d00a]  JavaThread::run()+0x27a
V  [libjvm.so+0x1791d18]  Thread::call_run()+0xf8
V  [libjvm.so+0x1393e49]  thread_native_entry(Thread*)+0x109
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk18u/pull/154 Date: 2022-06-21 07:10:51 +0000
21-06-2022

Fix Request (JDK 18u) Fixes a crash in C2. The fix is low risk and applies cleanly. Already tested and backported to Oracle JDK 17u.
21-06-2022

Fix request [17u] I backport this for parity with 17.0.5-oracle. A C2 fix we should backport. Clean backport. SAP nightly testing passed.
13-06-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/449 Date: 2022-06-09 07:43:13 +0000
09-06-2022

Changeset: dc635844 Author: Roland Westrelin <roland@openjdk.org> Date: 2022-04-25 08:32:50 +0000 URL: https://git.openjdk.java.net/jdk/commit/dc6358444b34a4861758a6b41aeebbe737345106
25-04-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8178 Date: 2022-04-11 12:30:32 +0000
11-04-2022

was introduced by JDK-8252372
08-03-2022

Re-targeting to 19 as it only affects debug build. [~hshi] are you currently working on that or could it be reassigned?
03-11-2021

Ah, sorry I somehow missed that. Thanks!
30-08-2021

This can reproduce with existing testcases make CONF=fastdebug run-test TEST="test/hotspot/jtreg/compiler/c2/TestCMoveHasTopInput.java test/hotspot/jtreg/compiler/loopopts/TestMainNeverExecuted.java" JTREG="VM_OPTIONS=-XX:+TraceLoopOpts"
30-08-2021

ILW = Crash while dumping a loop tree with debug flag TraceLoopOpts (does not affect product), single test? with TraceLoopOpts only, no workaround but disable TraceLoopOpts = MLM = P4
30-08-2021

Hi [~hshi], can you attach or show a failing testcase?
30-08-2021