JDK-8228485 : JVM crashes when bootstrap method for condy triggers loading of class whose static initializer throws exception
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12,13,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-07-22
  • Updated: 2020-06-01
  • Resolved: 2019-07-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14
11.0.5Fixed 13.0.1Fixed 14 b08Fixed
Description
Crash can be reproduced on following versions

openjdk version "11.0.2" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.2+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+7, mixed mode)

openjdk version "13-ea" 2019-09-17
OpenJDK Runtime Environment (build 13-ea+30)
OpenJDK 64-Bit Server VM (build 13-ea+30, mixed mode, sharing)

openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+6-171)
OpenJDK 64-Bit Server VM (build 14-ea+6-171, mixed mode, sharing)

using attached StaticInit.class and Example.class files

java -cp . Example

which were generated as following

javac -cp asm-7.1.jar:asm-tree-7.1.jar --release 11 Generator.java StaticInit.java
java -cp asm-7.1.jar:asm-tree-7.1.jar:. Generator

No crash when class StaticInit is loaded before invocation of bootstrap method

javac -cp . --release 11 ExampleNoCrash.java
java -cp . ExampleNoCrash

Comments
Fix Request (11u, 13u) Resolves the guaranteed VM crash with some condy usages. Patch applies cleanly to 13u, 11u. New test fails without the product fix, passes with it. tier1 passes in both 13u and 11u with patch applied. Risk is low: handling the trivial corner case where JVM crashes.
25-07-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/00ae3b739184 User: coleenp Date: 2019-07-24 14:59:42 +0000
24-07-2019

ILW = P3 Impact: High = crash Likelihood: Low = initialization order generally prevents this, <clinit> doesn't usually throw exceptions Workaround: Medium = might be hard for jacoco to fix source code initialization order or exception in <clinit>
23-07-2019