A DESCRIPTION OF THE PROBLEM :
We found that in the development version of Hotspot in JDK11, there exists an option that will crash the JVM as long as it is specified.
For example, for any test program like:
```java
public class Test {
public static void main(String[] args) {
System.out.println("Success Loaded!");
}
}
```
If we run this program on Ubuntu with OpenJDK11 using the following command:
```java
pathTo/jdk11u/build/linux-x86_64-normal-server-fastdebug/jdk/bin/java -XX:-OptoRemoveUseless -cp . Test
```
The output of the above command is:
```java
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/phaseX.cpp:1011
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/JVMs/LineCov/jdk11u/src/hotspot/share/opto/phaseX.cpp:1011), pid=8173, tid=8185
# assert(false) failed: Parse::remove_useless_nodes missed this node
#
# JRE version: OpenJDK Runtime Environment (11.0.21) (fastdebug build 11.0.21-internal+0-adhoc..jdk11u)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 11.0.21-internal+0-adhoc..jdk11u, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/tmp/core.8173)
#
# An error report file with more information is saved as:
# /home/tmp/hs_err_pid8173.log
#
# Compiler replay data is saved as:
# /home/tmp/replay_pid8173.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
Current thread is 8185
Dumping core ...
Aborted (core dumped)
```
Ubuntu Version:
```java
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
```
FREQUENCY : always
We found that in the development version of Hotspot in JDK11, there exists an option that will crash the JVM as long as it is specified.
For example, for any test program like:
```java
public class Test {
public static void main(String[] args) {
System.out.println("Success Loaded!");
}
}
```
If we run this program on Ubuntu with OpenJDK11 using the following command:
```java
pathTo/jdk11u/build/linux-x86_64-normal-server-fastdebug/jdk/bin/java -XX:-OptoRemoveUseless -cp . Test
```
The output of the above command is:
```java
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/phaseX.cpp:1011
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/JVMs/LineCov/jdk11u/src/hotspot/share/opto/phaseX.cpp:1011), pid=8173, tid=8185
# assert(false) failed: Parse::remove_useless_nodes missed this node
#
# JRE version: OpenJDK Runtime Environment (11.0.21) (fastdebug build 11.0.21-internal+0-adhoc..jdk11u)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 11.0.21-internal+0-adhoc..jdk11u, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/tmp/core.8173)
#
# An error report file with more information is saved as:
# /home/tmp/hs_err_pid8173.log
#
# Compiler replay data is saved as:
# /home/tmp/replay_pid8173.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
Current thread is 8185
Dumping core ...
Aborted (core dumped)
```
Ubuntu Version:
```java
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
```
FREQUENCY : always
- duplicates
-
JDK-8266618 Remove broken -XX:-OptoRemoveUseless
- Resolved