Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083128 | emb-9 | Roland Westrelin | P2 | Resolved | Fixed | team |
JDK-8068071 | 8u45 | Roland Westrelin | P2 | Resolved | Fixed | b02 |
JDK-8066243 | 8u40 | Roland Westrelin | P2 | Closed | Fixed | b19 |
JDK-8070933 | emb-8u47 | Roland Westrelin | P2 | Resolved | Fixed | team |
JDK-8072233 | 7u85 | Roland Westrelin | P2 | Resolved | Fixed | b01 |
JDK-8068577 | 7u80 | Roland Westrelin | P2 | Closed | Fixed | b05 |
This test fails when m1 is compiled by C2 because C2's range check smearing changes the array bound check of the first access to test only for lowest constant values of all array accesses.
public class TestRangeCheckSmearing {
static int m1(int[] array, int i, boolean allaccesses) {
int res = 0;
res += array[i+4];
if (allaccesses) {
res += array[i+3];
res += array[i+2];
res += array[i+1];
}
return res;
}
static public void main(String[] args) {
int[] array = new int[10];
for (int i = 0; i < 20000; i++) {
m1(array, 0, (i % 2) == 0);
}
boolean exception = false;
try {
m1(array, 8, false);
} catch(ArrayIndexOutOfBoundsException aioob) {
exception = true;
System.out.println("ArrayIndexOutOfBoundsException thrown for m1");
}
if (!exception) {
throw new RuntimeException("ArrayIndexOutOfBoundsException not throw");
}
}
}
ILW=H(may crash the VM) L (most bad array access will hit somewhere in the heap, has gone unnoticed for a long time) H(none)
public class TestRangeCheckSmearing {
static int m1(int[] array, int i, boolean allaccesses) {
int res = 0;
res += array[i+4];
if (allaccesses) {
res += array[i+3];
res += array[i+2];
res += array[i+1];
}
return res;
}
static public void main(String[] args) {
int[] array = new int[10];
for (int i = 0; i < 20000; i++) {
m1(array, 0, (i % 2) == 0);
}
boolean exception = false;
try {
m1(array, 8, false);
} catch(ArrayIndexOutOfBoundsException aioob) {
exception = true;
System.out.println("ArrayIndexOutOfBoundsException thrown for m1");
}
if (!exception) {
throw new RuntimeException("ArrayIndexOutOfBoundsException not throw");
}
}
}
ILW=H(may crash the VM) L (most bad array access will hit somewhere in the heap, has gone unnoticed for a long time) H(none)
- backported by
-
JDK-8068071 C2's range check smearing allows out of bound array accesses
-
- Resolved
-
-
JDK-8070933 C2's range check smearing allows out of bound array accesses
-
- Resolved
-
-
JDK-8072233 C2's range check smearing allows out of bound array accesses
-
- Resolved
-
-
JDK-8083128 C2's range check smearing allows out of bound array accesses
-
- Resolved
-
-
JDK-8066243 C2's range check smearing allows out of bound array accesses
-
- Closed
-
-
JDK-8068577 C2's range check smearing allows out of bound array accesses
-
- Closed
-
(1 backported by)