JDK-8216970 : condy causes JVM crash
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-01-14
  • Updated: 2019-09-26
  • Resolved: 2019-01-29
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 12 JDK 13
11.0.4Fixed 12.0.2Fixed 13 b06Fixed
Related Reports
Relates :  
Description
I tried to utilize https://openjdk.java.net/jeps/309 in JaCoCo project and discovered that this quite stably causes crash of JVM.

JaCoCo performs instrumentation of bytecode to record code coverage.
After https://github.com/Godin/jacoco/commit/09e1325ababb6859aa09b11a788ffb7aa5eb86a6
it will use condy to store probe array. For example instrumentation of

class Example {
  private Example() {
  }

  public static void main(String[] args) {
    System.out.println("Hello, World!");
  }
}

will look as following:

class Example {
  private Example() {
    boolean[] probes = // LDC
    probes[0] = true;
  }

  public static void main(String[] args) {
    boolean[] probes = // LDC
    System.out.println("Hello, World!");
    probes[1] = true;
  }

  // BSM:
  private static boolean[] $jacocoInit(MethodHandles.Lookup lookup, String name, Class cls);
}

Don't know how to create reduced example, however this can be reproduced as following: 

git clone https://github.com/Godin/jacoco --single-branch --branch=condy_jvm_crash && cd jacoco
mvn clean package -Dmaven.javadoc.skip -Dbytecode.version=11

Comments
Fix Request Backporting this fix resolves the corner case in condy handling. Patch applies cleanly to 11u and 12u. New regression tests fail without the patch in both 11u and 12u, and pass with the patch. Patched JDK also passes runtime/condy and java/lang/invoke/condy suites.
09-04-2019

FWIW no more crashes during build with JDK 13 EA b6. Thanks Lois! Also seems that as a workaround for previous versions condy instead of array can use Object followed by checkcast into array.
01-02-2019

I'm wondering if possible to consider fix of this issue for inclusion into JDK 12? In this case we (JaCoCo) can consider addition of usage of condy for Java 12 bytecode, spreading testing of condy on our users.
28-01-2019

Issue is reproducible from JDK11 build 1 onwards
14-01-2019