Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315922

Inconsistent behavior between different OpenJDK versions and different OS

XMLWordPrintable

    • aarch64
    • os_x

      A DESCRIPTION OF THE PROBLEM :
      Inconsistent behavior between different OpenJDK versions and different OS under vm option AliasLevel

      First, when providing an abnormal value to the "AliasLevel" parameter along with a non-existent test, the hotspot of OpenJDK8 crashes on macOS.

      For example, If we run this program on Ubuntu with OpenJDK8 using the following command:

      ```
      ./OpenJDK8U-jre_x64_linux_hotspot_8u382b05/bin/java -XX:AliasLevel=2147483647 NonExistProgram
      ```

      The output of the above command is:

      ```
      Error: Could not find or load main class NonExistProgram
      ```

      However, running the following command on macOS with OpenJDK8:

      ```
      ./jre1.8.0_371.jre/Contents/Home/bin/java -XX:AliasLevel=2147483647 NonExistProgram
      ```

      The hotspot will crash and output the following:

      ```
      [thread 22019 also had an error]# A fatal error has been detected by the Java Runtime Environment:

      [thread 32515 also had an error]#

      # Internal Error (compile.cpp:1571), pid=52150, tid=0x0000000000005803
      # Error: Unimplemented()
      #
      # JRE version: Java(TM) SE Runtime Environment (8.0_371) (build 1.8.0_371-b11)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.371-b11 mixed mode bsd-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:
      # path/hs_err_pid52150.log
      Error: Could not find or load main class NonExistProgram
      #
      # Compiler replay data is saved as:
      # path/replay_pid52150.log
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #
      ```

      macOS version:

      ```
      Software:

          System Software Overview:

            System Version: macOS 13.2 (22D49)
            Kernel Version: Darwin 22.3.0
            Boot Volume: Macintosh HD
            Boot Mode: Normal
            Computer Name: MacBook Pro
            User Name: MacBook
            Secure Virtual Memory: Enabled
            System Integrity Protection: Enabled
            Time since boot: 1 day, 2 hours, 19 minutes

      Hardware:

          Hardware Overview:

            Model Name: MacBook Pro
            Model Identifier: MacBookPro18,1
            Model Number: MK193CH/A
            Chip: Apple M1 Pro
            Total Number of Cores: 10 (8 performance and 2 efficiency)
            Memory: 16 GB
            System Firmware Version: 8419.80.7
            OS Loader Version: 8419.80.7
            Activation Lock Status: Disabled
      ```

      Secondly, the output of running a test program with an abnormal value for "AliasLevel" is also inconsistent across different versions.

      Here's an example of the test program:

      ```
      public class AliasLevelTest {
          public static void main(String[] args) {
              System.out.println("Success Loaded!");
          }
      }
      ```

      If we run this program on Ubuntu with OpenJDK11 using the following command:

      ```
      ./OpenJDK11U-jre_x64_linux_hotspot_11.0.20.1_1/bin/java -XX:AliasLevel=2147483647 AliasLevelTest
      ```

      The expect output is:

      ```
      intx AliasLevel=2147483647 is outside the allowed range [ 0 ... 3 ]
      Improperly specified VM option 'AliasLevel=2147483647'
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.
      ```

      However, when running the same program on Ubuntu with OpenJDK8 using the following command:

      ```
      ./OpenJDK8U-jre_x64_linux_hotspot_8u382b05/bin/java -XX:AliasLevel=2147483647 AliasLevelTest
      ```

      The output of the above command is:

      ```
      Success Loaded!
      ```

      It is evident that the behavior varies between different OpenJDK versions and different operating systems, leading to crashes and inconsistent error messages.


      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: