Skip to content

OpenJ9 Crashes on ECJ-Compiled Class File #21417

Open
@yingquanzhao

Description

@yingquanzhao

Java -version output

JDK 9:
openjdk version "1.8.0_442"
IBM Semeru Runtime Open Edition (build 1.8.0_442-b06)
Eclipse OpenJ9 VM (build openj9-0.49.0, JRE 1.8.0 Mac OS X amd64-64-Bit Compressed References 20250205_1183 (JIT enabled, AOT enabled)
OpenJ9   - 3c3d179854
OMR      - e49875871
JCL      - 61f83383b8 based on jdk8u442-b06)

JDK 11:
openjdk version "11.0.26" 2025-01-21
IBM Semeru Runtime Open Edition 11.0.26.0 (build 11.0.26+4)
Eclipse OpenJ9 VM 11.0.26.0 (build openj9-0.49.0, JRE 11 Mac OS X aarch64-64-Bit 20250205_839 (JIT enabled, AOT enabled)
OpenJ9   - 3c3d179854
OMR      - e49875871
JCL      - 674ad23a80 based on jdk-11.0.26+4)

JDK 17:
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 Mac OS X aarch64-64-Bit 20250121_796 (JIT enabled, AOT enabled)
OpenJ9   - 3c3d179854
OMR      - e49875871
JCL      - cbbc8b94a62 based on jdk-17.0.14+7)

JDK 21:
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 Mac OS X aarch64-64-Bit 20250121_371 (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 identified a test program that causes OpenJ9 to crash.

Below is the source code of the test program:

public class Test {
    public static float func() {
        int a = 223, arr[]=new int[400];
        for (int i = 1; i < 100; i++) {
            for (int i1 = 1; i1 < 10; i1++){
                try {
                    a = (1 % a);
                    arr[i1 + 1] = (i1 / -871268305);
                } catch (ArithmeticException e) {}
            }
        }
        return Double.doubleToLongBits(1);
    }

    public static void main(String[] strArr) {
        for (int i = 1; i < 100; ++i) {
            func();
        }
    }
}

When this program is compiled by javac, OpenJ9 runs the generated class file without any issues. However, when compiled using ecj, running the generated class file on OpenJ9 triggers a crash, while HotSpot runs it successfully without any problem. This issue is reproducible on OpenJDK 11, 17, and 21 but does not occur on OpenJDK 8, where the program executes normally.

Steps to Reproduce

The following commands were used to compile and execute the test program:

pathTo/jdk-21.0.6+7/bin/java -cp . -jar ./ecj-4.35.jar --release 21 -d . Test.java
pathToOpenJ9/jdk-21.0.6+7/bin/java -cp . Test

pathTo/jdk-21.0.6+7/bin/java -cp . -jar ./ecj-4.35.jar --release 17 -d . Test.java
pathToOpenJ9/jdk-17.0.14+7-jre/bin/java -cp . Test

pathTo/jdk-21.0.6+7/bin/java -cp . -jar ./ecj-4.35.jar --release 11 -d . Test.java
pathToOpenJ9/jdk-11.0.26+4-jre/bin/java -cp . Test

All ECJ-compiled test programs crash when executed using OpenJ9. We have uploaded the test program along with the necessary dependencies, which can be downloaded from CrashWithEcj.zip.

Would appreciate your insights into this issue. Thanks!

Note that, this issue is only reproducible on Ubuntu. On macOS, OpenJ9 does not crash.

Software and Hardware Environment:

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