Details
-
Bug
-
Resolution: Fixed
-
P2
-
repo-valhalla
-
x86
-
linux
Description
Hotspot has intermittent crash on assigning 2-fields value type into array.
Rate of crashes: ~25 crashes from 100 executions.
At the same moment, similar tests with 1-field value class and 8-fields value class did not crash (checked on ~300 executions).
Example of hs_err file is attached.
Code:
public Object bc_value() {
ValueI2[] values = new ValueI2[SIZE];
for (int i = 0, k = 0; i < values.length; i++, k += 2) {
values[i] = ValueI2.of(k, k + 1);
}
return values;
}
where ValueI2 is:
public __ByValue final class ValueI2 {
public final int re;
public final int im;
public ValueI2() {
this.re = 0;
this.im = 0;
}
public int re() {
return re;
}
public int im() {
return im;
}
public ValueI2 add(ValueI2 v) {
return of(this.re() + v.re(), this.im() + v.im());
}
public ValueI2 mul(ValueI2 v) {
int tre = this.re();
int tim = this.im();
int vre = v.re();
int vim = v.im();
return of(tre * vre - tim*vim, tre*vim + vre*tim);
}
__ValueFactory public static ValueI2 of(int re, int im) {
ValueI2 v = __MakeDefault ValueI2();
v.re = re;
v.im = im;
return v;
}
How to reproduce:
1. get benchmarks.jar file (attached) or build it from sources (sources are available at http://cr.openjdk.java.net/~skuksenko/valhalla/benchmarks/src.zip )
2. execute:
java -noverify -XX:+EnableMVT -jar benchmarks.jar arrayfill.FillI2.bc_value -f 1
Note: crash doesn't depend on turning tiered compilation on/off
Rate of crashes: ~25 crashes from 100 executions.
At the same moment, similar tests with 1-field value class and 8-fields value class did not crash (checked on ~300 executions).
Example of hs_err file is attached.
Code:
public Object bc_value() {
ValueI2[] values = new ValueI2[SIZE];
for (int i = 0, k = 0; i < values.length; i++, k += 2) {
values[i] = ValueI2.of(k, k + 1);
}
return values;
}
where ValueI2 is:
public __ByValue final class ValueI2 {
public final int re;
public final int im;
public ValueI2() {
this.re = 0;
this.im = 0;
}
public int re() {
return re;
}
public int im() {
return im;
}
public ValueI2 add(ValueI2 v) {
return of(this.re() + v.re(), this.im() + v.im());
}
public ValueI2 mul(ValueI2 v) {
int tre = this.re();
int tim = this.im();
int vre = v.re();
int vim = v.im();
return of(tre * vre - tim*vim, tre*vim + vre*tim);
}
__ValueFactory public static ValueI2 of(int re, int im) {
ValueI2 v = __MakeDefault ValueI2();
v.re = re;
v.im = im;
return v;
}
How to reproduce:
1. get benchmarks.jar file (attached) or build it from sources (sources are available at http://cr.openjdk.java.net/~skuksenko/valhalla/benchmarks/src.zip )
2. execute:
java -noverify -XX:+EnableMVT -jar benchmarks.jar arrayfill.FillI2.bc_value -f 1
Note: crash doesn't depend on turning tiered compilation on/off