ADDITIONAL SYSTEM INFORMATION :
OS: 22.04
A DESCRIPTION OF THE PROBLEM :
C2 crash when compile the following code without any options:
```
import java.util.Arrays;
public class TestIllegalArrayCopyBeforeInfiniteLoop {
private static char src[] = new char[10];
private static int count = 0;
private static final int iter = 10_000;
public static void main(String[] args) throws Exception {
for (int i = 0; i < iter; ++i) {
foo();
}
if (count != iter) {
throw new RuntimeException("test failed");
}
}
static void foo() {
try {
Arrays.copyOfRange(src, -1, 128);
do {
} while (true);
} catch (ArrayIndexOutOfBoundsException ex) {
count++;
}
}
}
```
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To reproduce:
`java TestIllegalArrayCopyBeforeInfiniteLoop.java`
---------- BEGIN SOURCE ----------
import java.util.Arrays;
public class TestIllegalArrayCopyBeforeInfiniteLoop {
private static char src[] = new char[10];
private static int count = 0;
private static final int iter = 10_000;
public static void main(String[] args) throws Exception {
for (int i = 0; i < iter; ++i) {
foo();
}
if (count != iter) {
throw new RuntimeException("test failed");
}
}
static void foo() {
try {
Arrays.copyOfRange(src, -1, 128);
do {
} while (true);
} catch (ArrayIndexOutOfBoundsException ex) {
count++;
}
}
}
---------- END SOURCE ----------
OS: 22.04
A DESCRIPTION OF THE PROBLEM :
C2 crash when compile the following code without any options:
```
import java.util.Arrays;
public class TestIllegalArrayCopyBeforeInfiniteLoop {
private static char src[] = new char[10];
private static int count = 0;
private static final int iter = 10_000;
public static void main(String[] args) throws Exception {
for (int i = 0; i < iter; ++i) {
foo();
}
if (count != iter) {
throw new RuntimeException("test failed");
}
}
static void foo() {
try {
Arrays.copyOfRange(src, -1, 128);
do {
} while (true);
} catch (ArrayIndexOutOfBoundsException ex) {
count++;
}
}
}
```
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To reproduce:
`java TestIllegalArrayCopyBeforeInfiniteLoop.java`
---------- BEGIN SOURCE ----------
import java.util.Arrays;
public class TestIllegalArrayCopyBeforeInfiniteLoop {
private static char src[] = new char[10];
private static int count = 0;
private static final int iter = 10_000;
public static void main(String[] args) throws Exception {
for (int i = 0; i < iter; ++i) {
foo();
}
if (count != iter) {
throw new RuntimeException("test failed");
}
}
static void foo() {
try {
Arrays.copyOfRange(src, -1, 128);
do {
} while (true);
} catch (ArrayIndexOutOfBoundsException ex) {
count++;
}
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8263577 C2: reachable nodes shouldn't have dead uses at the end of optimizations
- Resolved
- relates to
-
JDK-8312438 assert(n->req() == 2 && n->in(1) != __null) failed: Only one data input expected
- Closed