JDK-8274785 : ciReplay: Potential crash due to uninitialized Compile::_ilt variable
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,11,17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-10-05
  • Updated: 2021-10-11
  • Resolved: 2021-10-08
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 18
18 masterFixed
Related Reports
Relates :  
Description
The inline tree Compile::_ilt is not initialized directly by the initializer list but only later in Compile::Compile() when calling:

 _ilt = InlineTree::build_inline_tree_root();

Before this assignment, _ilt contains garbage (i.e. != NULL). When hitting an assert or crash before returning from build_inline_tree_root(), replay compilation is trying to dump the inline tree and fails to notice that the inline tree is still uninitialized. This results in a segmentation fault (tested by adding an artificial assert(false, "asdf")):

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/compile.cpp:614
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/christian/jdk/open/src/hotspot/share/opto/compile.cpp:614), pid=68690, tid=68698
#  assert(false) failed: asdf
#
# JRE version: Java(TM) SE Runtime Environment (18.0) (slowdebug build 18-internal+0-2021-10-04-0649352.christian...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 18-internal+0-2021-10-04-0649352.christian..., compiled mode, compressed oops, compressed class ptrs, serial gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x7aca5c]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x81c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/christian/repro/ciReplay/hs_err_pid68690.log

[error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007ff6cef2a748]

#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

Comments
Changeset: 36b89a18 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-10-08 14:51:18 +0000 URL: https://git.openjdk.java.net/jdk/commit/36b89a18931d42b8002a843ec8218b5c1ba54374
08-10-2021

ILW = Potential crash when dumping inline data on error (crash, assertion) with a debug build, never observed, no workaround = MLH = P4
05-10-2021