JDK-8317823 : assert(has_error == false) failed: register allocation invalid
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2023-09-26
  • Updated: 2023-10-10
Description
ADDITIONAL SYSTEM INFORMATION :
# JRE version: OpenJDK Runtime Environment (8.0_392) (build 1.8.0_392-internal-fastdebug--b00) # Java VM: OpenJDK 64-Bit Server VM (25.392-b00-fastdebug compiled mode linux-amd64 compressed oops)

A DESCRIPTION OF THE PROBLEM :
I ran a modified regression test case on JDK8u392 and found that the JVM crashed with -Xcomp options.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/data//jdk8u/hotspot/src/share/vm/c1/c1_LinearScan.cpp:3253), pid=8928, tid=0x00007fb716050700
#  assert(has_error == false) failed: register allocation invalid
#
# JRE version: OpenJDK Runtime Environment (8.0_392) (build 1.8.0_392-internal-fastdebug--b00)
# Java VM: OpenJDK 64-Bit Server VM (25.392-b00-fastdebug compiled mode linux-amd64 compressed oops)
# Failed to write core dump. 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:
#   http://bugreport.java.com/bugreport/crash.jsp
#

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java  -Xcomp -cp "6/" compiler.regalloc.TestC1OverlappingRegisterHint

ACTUAL -
Intervals 412 and 434 overlap and have the same register assigned
412 int "[stack:3|I]" 209 209 [375, 440[ [446, 478[ 398 S 440 S 478 S  "no optimization"

434 int "[stack:3|I]" 238 238 [399, 404[  "no optimization"

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/c1_LinearScan.cpp:3253
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/data//jdk8u/hotspot/src/share/vm/c1/c1_LinearScan.cpp:3253), pid=8928, tid=0x00007fb716050700
#  assert(has_error == false) failed: register allocation invalid
#
# JRE version: OpenJDK Runtime Environment (8.0_392) (build 1.8.0_392-internal-fastdebug--b00)
# Java VM: OpenJDK 64-Bit Server VM (25.392-b00-fastdebug compiled mode linux-amd64 compressed oops)
# Failed to write core dump. 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//repository//toreport/TestC1OverlappingRegisterHint_09_24_23_57_54/hs_err_pid8928.log
#
# Compiler replay data is saved as:
# /home//repository//toreport/TestC1OverlappingRegisterHint_09_24_23_57_54/replay_pid8928.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------- BEGIN SOURCE ----------
The source code file and hs_err file are available at the URL: 
https://drive.google.com/file/d/1_d9LHocAj-4aVRMB5Azasod5huqEK7uO/view?usp=drive_link
---------- END SOURCE ----------

FREQUENCY : always



Comments
Issue is reproduced in fast-debug builds for JDK 8. Tested on Linux linux 4.18.0-372.13.1.0.1.el8_6.x86_64 1.8.0_20-fastdebug-b25 Fail 1.8.0_131-fastdebug-b11 Fail 1.8.0_141-fastdebug-b15 Fail 1.8.0_151-fastdebug-b12 Fail 1.8.0_361-fastdebug-b09 Fail 1.8.0_381-fastdebug-b09 Fail 1.8.0_381-b25 Pass 1.8.0_391-fastdebug-b13 Fail fastdebug build 11+1 Pass build 11.0.15.1.2+1-LTS-3 Pass fastdebug build 11.0.20.0.4+1-LTS-4 Pass build 11.0.20.0.4+1-LTS-4 Pass fastdebug build 17-ea+1-LTS-11 Pass build 17.0.8+9-LTS-211 Pass build 21.0.1+11-LTS-27 Pass ILW = assertion failure in debug JDK, reproducible with single test, no workaround available = HLM = P2 Moving to dev for further analysis.
10-10-2023