Skip to content

System.Logger Triggers J9 Crash on OpenJDK 17 and 21 #21419

Description

@yingquanzhao

Java -version output

openjdk version "17.0.14" 2025-01-21
IBM Semeru Runtime Open Edition 17.0.14.0 (build 17.0.14+7)
Eclipse OpenJ9 VM 17.0.14.0 (build openj9-0.49.0, JRE 17 Linux amd64-64-Bit Compressed References 20250121_961 (JIT enabled, AOT enabled)
OpenJ9   - 3c3d179854
OMR      - e49875871
JCL      - cbbc8b94a62 based on jdk-17.0.14+7)

openjdk version "21.0.6" 2025-01-21 LTS
IBM Semeru Runtime Open Edition 21.0.6.0 (build 21.0.6+7-LTS)
Eclipse OpenJ9 VM 21.0.6.0 (build openj9-0.49.0, JRE 21 Linux amd64-64-Bit Compressed References 20250121_380 (JIT enabled, AOT enabled)
OpenJ9   - 3c3d179854
OMR      - e49875871
JCL      - e01368f00df based on jdk-21.0.6+7)

Output from java -version.

Summary of problem

Hi, we have found a test program that causes OpenJ9 to crash. Below is the minimized version of the test program:

public class Test {

    public static long var1 = 1871533038L;
    public double var2 = 1;
    public int var3 = 1;

    public void mainTest(String[] strArr1) {
        
        for (int i = 1; i < 5; i++) {

            System.Logger logger = System.getLogger(Test.class.getName());
            logger.log(System.Logger.Level.INFO, "Logging example");
            try {
                java.lang.reflect.Method method = Test.class.getMethod("mainTest", String[].class);
                method.invoke(this, (Object) strArr1);
            } catch (NoSuchMethodException e) {
                // ...
            } catch (IllegalAccessException e) {
                // ...
            } catch (java.lang.reflect.InvocationTargetException e) {
                // ...
            }
        }
        System.out.println("Value: " + Test.var1 + "," + Double.doubleToLongBits(var2) + "," + var3);
    }

    public static void main(String[] strArr) {
        new Test().mainTest(strArr);
    }
}

When compiled and executed this test program using OpenJDK 17 and OpenJDK 21, OpenJ9 crashes after running for approximately one minute. However, the issue does not occur when using OpenJDK 11 or other JVM implementations (such as HotSpot).
The core dump file generated from the crash can be downloaded from CoreDumpFile.zip.

Steps to Reproduce

1. Compile test program:
>>> javac Test.java

2. Excute test program:
>>> pathToOpenJ9/jdk-17.0.14+7-jre/bin/java -cp . Test
>>> pathToOpenJ9/jdk-21.0.6+7/bin/java -cp . Test

We have tested on both macOS and Ubuntu, and the crash can be triggered on both platforms.

We would appreciate it if you could take a look at this issue. Thank you!

Test Environment

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

ubuntu version:

OS:
    lsb_release -a output:		
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04.6 LTS
    Release:        20.04
    Codename:       focal

Diagnostic files

The core dump file can be found in the attachment.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions