-
Bug
-
Resolution: Fixed
-
P1
-
9
-
b66
-
b81
-
x86
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8141876 | emb-9 | Roland Westrelin | P1 | Resolved | Fixed | team |
Testing observed a NPE in java.time.ZoneId.systemDefault() after C2 compilation.
import java.io.IOException;
import java.time.ZoneId;
import java.util.TimeZone;
public class CloneBug {
static final TimeZone UTC = TimeZone.getTimeZone("UTC");
static void test() {
TimeZone.setDefault(UTC);
for (int i = 0; i < 16801; i++) {
ZoneId.systemDefault();
}
}
public static void main(String[] args) throws IOException {
for (int i = 0; i < 100; i++) {
test();
}
}
}
Expected output: Nothing
Actual output:
Exception in thread "main" java.lang.NullPointerException
at java.util.TimeZone.toZoneId0(TimeZone.java:560)
at java.util.TimeZone.toZoneId(TimeZone.java:550)
at java.time.ZoneId.systemDefault(ZoneId.java:274)
at CloneBug.test(CloneBug.java:13)
at CloneBug.main(CloneBug.java:19)
Supplying any of the following avoids the issue:
-Xint
-XX:-DoEscapeAnalysis
-XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_clone
-XX:TieredStopAtLevel=1
Issue still reproduce using:
-XX:-TieredCompilation
Issue narrowed down to 9-b66, still exists in 9-b71
ILW = Unavoidable exceptions in compiled code (H), heavy use of publicly available method used internally in the JDK will trigger (H), disabling escape analysis avoids issue entirely (L) = HHL = P2
import java.io.IOException;
import java.time.ZoneId;
import java.util.TimeZone;
public class CloneBug {
static final TimeZone UTC = TimeZone.getTimeZone("UTC");
static void test() {
TimeZone.setDefault(UTC);
for (int i = 0; i < 16801; i++) {
ZoneId.systemDefault();
}
}
public static void main(String[] args) throws IOException {
for (int i = 0; i < 100; i++) {
test();
}
}
}
Expected output: Nothing
Actual output:
Exception in thread "main" java.lang.NullPointerException
at java.util.TimeZone.toZoneId0(TimeZone.java:560)
at java.util.TimeZone.toZoneId(TimeZone.java:550)
at java.time.ZoneId.systemDefault(ZoneId.java:274)
at CloneBug.test(CloneBug.java:13)
at CloneBug.main(CloneBug.java:19)
Supplying any of the following avoids the issue:
-Xint
-XX:-DoEscapeAnalysis
-XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_clone
-XX:TieredStopAtLevel=1
Issue still reproduce using:
-XX:-TieredCompilation
Issue narrowed down to 9-b66, still exists in 9-b71
ILW = Unavoidable exceptions in compiled code (H), heavy use of publicly available method used internally in the JDK will trigger (H), disabling escape analysis avoids issue entirely (L) = HHL = P2
- backported by
-
JDK-8141876 Cloned object's fields observed as null after C2 escape analysis
-
- Resolved
-
- relates to
-
JDK-8263781 C2: Cannot hoist independent load above arraycopy
-
- Resolved
-
-
JDK-8134321 tools/pack200/Pack200Test.java crashes in the VM PIT jdk9 b79
-
- Closed
-