Repository navigation
Description
Affected versions
We found a test case with execution problems. To facilitate analysis, we simplified the test case and the simplified class file can ben found at attachment.
Windows 10:
Microsoft Windows 10 Professional
10.0.19044 Build 19044
AMD Ryzen 5 5600G with Radeon Graphics 3.90 GHz
Memory 32 GB
Java -version output under Windows 10
openjdk version "1.8.0_332"
IBM Semeru Runtime Open Edition (build 1.8.0_332-b09)
Eclipse OpenJ9 VM (build openj9-0.32.0, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20220422_375 (JIT enabled, AOT enabled)
OpenJ9 - 9a84ec34e
OMR - ab24b6666
JCL - 0b8b8af39a based on jdk8u332-b09)
openjdk version "11.0.15" 2022-04-19
IBM Semeru Runtime Open Edition 11.0.15.0 (build 11.0.15+10)
Eclipse OpenJ9 VM 11.0.15.0 (build openj9-0.32.0, JRE 11 Windows 10 amd64-64-Bit Compressed References 20220422_352 (JIT enabled, AOT enabled)
OpenJ9 - 9a84ec34e
OMR - ab24b6666
JCL - b7b5b42ea6 based on jdk-11.0.15+10)
Problem summary
When we try to execute the following test case using OpenJ9, we may get incorrect output. The final output checksum value is 0 when executed correctly. However, when we run the test case using JDK8, the output will get one of the values 536870912,1073741824,1610612736,-2147483648,-1610612736,-1073741824,-536870912,0 .Executing test cases using JDK11 does not always result in incorrect output, or maybe we need to run it a few more times to see if there's a issue.
In addition, we also try to add the -xint tag at execution time, and JDK8 will not produce incorrect output.
public class testCase9 {
public static int[] src2 = new int[1];
public static int[] dst2;
public static int my_check_sum = 0;
public testCase9() {
}
public static void main(String[] var0) {
dst2 = new int[536870913];
int var2;
for(var2 = 0; var2 < 20000; ++var2) {
test();
}
System.out.print("my_check_sum_value:");
System.out.println(my_check_sum);
}
public static void test() {
int var0 = 536870912;
System.arraycopy(src2, 0, dst2, var0, 1);
System.arraycopy(dst2, var0, src2, 0, 1);
my_check_sum = Integer.hashCode(my_check_sum+Integer.hashCode(var0));
}
}
Activity
BradleyWood commentedon Jul 11, 2022
Looks like something went wrong in LocalVP. I see that VP came to the conclusion that the second arraycopy will always fail a bounds check [1], then removes everything following the bounds check [2].
[1]
[2]
pshipton commentedon Jul 11, 2022
@0xdaryl fyi
0xdaryl commentedon Jul 11, 2022
@BradleyWood : please investigate
0xdaryl commentedon Sep 20, 2022
This will not be fixed for 0.35. Moving to 0.36.
0xdaryl commentedon Nov 15, 2022
Moving to 0.38.
@BradleyWood : it might be worth verifying if this problem still exists because several VP fixes were made over the past few months.
12 remaining items
maggietuttle commentedon Sep 19, 2024
This issue no longer appears to be reproducible since omr #7461. Closing.
maggietuttle commentedon Oct 3, 2024
Reopen until the PR is added to 0.48
github-actions commentedon Oct 3, 2024
Issue Number: 15500
Status: Closed
Actual Components: prio:high, comp:jit, userRaised
Actual Assignees: No one :(
PR Assignees: No one :(