Skip to content

Instantly share code, notes, and snippets.

@marchof

marchof/Console.txt

Created Aug 12, 2016
Embed
What would you like to do?
Exception in Cyclic interface causes JVM Crash
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006fe21b55, pid=14180, tid=0x00000000000038dc
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x201b55]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\sbbdev\eclipse-ws-rcs-trunk\ch.sbb.rcs.java8examples\hs_err_pid14180.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
/**
* This snippet crashes with
* - Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
*/
public class JvmCrash {
interface Base {
static final Object CONST = new Target(){}.someMethod();
default void important() {
// Super interfaces with default methods get initialized (JLS 12.4.1)
}
}
interface Target extends Base {
default Object someMethod() {
throw new RuntimeException();
}
}
public static void main(String[] args) {
new Target() {};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment