让我们看看以下Java代码。
public class Main
{
public static void main(String[] args) throws IOException
{
PathDasher p = new PathDasher(null) ;
}
}
当我在Java 6中尝试上述代码时,检测到胎儿错误如下。
run:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d9add45, pid=1588, tid=3808
#
# JRE version: 6.0_21-b07
# Java VM: Java HotSpot(TM) Client VM (17.0-b17 mixed mode, sharing windows-x86 )
# Problematic frame:
# V [jvm.dll+0xfdd45]
#
# An error report file with more information is saved as:
# E:\Project\FunnyName\hs_err_pid1588.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
是否会导致JVM崩溃?
答案 0 :(得分:3)
如果这是代码,http://www.dei.unipd.it/ricerca/gmee/MeLa/MeLa/test/source/sun/dc/pr/PathDasher.java似乎传递null
传递给本机方法,如果JVM无法正确处理它,可能会导致JVM崩溃。