摘要
我能够使用main方法编译一个接口,该方法使用448个Runnable方法引用实例(System :: gc)调用null MethodHandle的invokeExact方法。
当我运行接口时,Java Runtime Environment会检测到致命错误:
源代码和运行时结果链接:http://ideone.com/3oh7Uk
来源
interface $ {
static void main(String[] $) throws Throwable {
((java.lang.invoke.MethodHandle) null).invokeExact(
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc,
(Runnable) System::gc
);
}
}
结果
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb71b9bde, pid=12918, tid=3030936432
#
# JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
# Java VM: Java HotSpot(TM) Client VM (25.51-b03 mixed mode linux-x86 )
# Problematic frame:
# V [libjvm.so+0x507bde] SignatureIterator::parse_type()+0x1ce
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# Can not save log file, dump to screen..
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb71b9bde, pid=12918, tid=3030936432
#
# JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
# Java VM: Java HotSpot(TM) Client VM (25.51-b03 mixed mode linux-x86 )
# Problematic frame:
# V [libjvm.so+0x507bde] SignatureIterator::parse_type()+0x1ce
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://b...content-available-to-author-only...a.com/bugreport/crash.jsp
#