eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

JDK8 and JDK11 were able to throw exceptions normally, but JDK17 triggered crash #17247

Closed TemporaryRepos closed 1 year ago

TemporaryRepos commented 1 year ago

Java -version output

openjdk version "17.0.6" 2023-01-17
IBM Semeru Runtime Open Edition 17.0.6.0 (build 17.0.6+10)
Eclipse OpenJ9 VM 17.0.6.0 (build openj9-0.36.0, JRE 17 Linux amd64-64-Bit Compressed References 20230117_397 (JIT enabled, AOT enabled)
OpenJ9   - e68fb241f
OMR      - f491bbf6f
JCL      - 927b34f84c8 based on jdk-17.0.6+10)

openjdk version "11.0.18" 2023-01-17
IBM Semeru Runtime Open Edition 11.0.18.0 (build 11.0.18+10)
Eclipse OpenJ9 VM 11.0.18.0 (build openj9-0.36.1, JRE 11 Linux amd64-64-Bit Compressed References 20230214_644 (JIT enabled, AOT enabled)
OpenJ9   - 0592661e4
OMR      - f491bbf6f
JCL      - 4e060ceb0b based on jdk-11.0.18+10)

openjdk version "1.8.0_362"
IBM Semeru Runtime Open Edition (build 1.8.0_362-b09)
Eclipse OpenJ9 VM (build openj9-0.36.0, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20230206_588 (JIT enabled, AOT enabled)
OpenJ9   - e68fb241f
OMR      - f491bbf6f
JCL      - eebde685ec based on jdk8u362-b09)

Summary of problem

crash is triggered when the test program is executed. We tried to simplify the test cases to reduce the cost of analysis for developers, but when we converted the simplified jimple code to bytecode, crash would no longer trigger. So the number of lines of code of our submitted test cases is still relatively high, which may raise the cost of analysis. Test cases capable of triggering crash have been submitted as attachments.

Diagnostic files

Exception in thread "main" 02:07:01.167 0x18d00 omrport.359    *   ** ASSERTION FAILED ** at /home/jenkins/workspace/build-scripts/jobs/jdk17u/jdk17u-linux-x64-openj9/workspace/build/src/omr/port/common/omrmemtag.c:145: ((memoryCorruptionDetected))
JVMDUMP039I Processing dump event "traceassert", detail "" at 2023/04/23 10:07:01 - please wait.
JVMDUMP032I JVM requested System dump using '/home/ningmo/project/TestCast/testcase3/core.20230423.100701.194448.0001.dmp' in response to an event
JVMPORT030W /proc/sys/kernel/core_pattern setting "|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" specifies that the core dump is to be piped to an external program.  Attempting to rename either core or core.194471.

JVMDUMP012E Error in System dump: The core file created by child process with pid = 194471 was not found. Expected to find core file with name "/home/ningmo/project/TestCast/testcase3/core.194471"
JVMDUMP032I JVM requested Java dump using '/home/ningmo/project/TestCast/testcase3/javacore.20230423.100701.194448.0002.txt' in response to an event
JVMDUMP010I Java dump written to /home/ningmo/project/TestCast/testcase3/javacore.20230423.100701.194448.0002.txt
JVMDUMP032I JVM requested Snap dump using '/home/ningmo/project/TestCast/testcase3/Snap.20230423.100701.194448.0003.trc' in response to an event
JVMDUMP010I Snap dump written to /home/ningmo/project/TestCast/testcase3/Snap.20230423.100701.194448.0003.trc
JVMDUMP013I Processed dump event "traceassert", detail "".

testcase3_diagnosticFiles.zip

ByteCode

testcase3_bytecode.zip

Steps to Reproduce

jdk_linux_17_openj9/bin/java compiler.codegen.TestLongDoubleVect

pshipton commented 1 year ago

Recreates with -Xint. @tajila

To give an idea, decompile of TestLongDoubleVect attached. TestLongDoubleVect.txt

theresa-m commented 1 year ago

The crash is caused by stack corruption detected at https://github.com/eclipse-openj9/openj9/blob/master/runtime/j9vm/javanextvmi.cpp#L171

Looking into why its gone wrong. This is part of JEP 358 from Java 14.

theresa-m commented 1 year ago

Still looking at this but I wanted to point out that you can use the option -XX:-ShowCodeDetailsInExceptionMessages as a workaround to this issue @TemporaryRepos