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