黑马程序员技术交流社区

标题: JVM bug [打印本页]

作者: toShareBeauty    时间: 2013-7-9 22:36
标题: JVM bug
本帖最后由 杨兴庭 于 2013-7-10 22:31 编辑
  1. public class StringObjectDemo {

  2.         /**
  3.          * @param args
  4.          */
  5.         public static void main(String[] args) {
  6.                 // TODO Auto-generated method stub
  7.                 Object s1 = "HelloWorld";
  8.                 Object s2 = new String("HelloWorld");
  9.         }
  10. }
复制代码
上面是源代码,我在 Object s2 = new String("HelloWorld");  这里加了一个 Breakpoint ,结果一调试,我在这个断点这里我选择 Step Into,就直接报下面这个错误了{:soso_e141:}
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006d90503e, pid=43300, tid=21404
#
# JRE version: 6.0_43-b01
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x4503e]
#
# An error report file with more information is saved as:
# D:\Users\vivianZhao\Workspaces\MyEclipse Professional\Java5NewFeature\hs_err_pid43300.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


下面是错误日志文件:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006d90503e, pid=33424, tid=61396
#
# JRE version: 6.0_43-b01
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x4503e]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x0000000006629800):  JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=61396, stack(0x0000000006cf0000,0x0000000006df0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000008

Registers:
RAX=0x0000000000000014, RBX=0x0000000006629800, RCX=0x00000000eb3a4a80, RDX=0x0000000000000000
RSP=0x0000000006def980, RBP=0x0000000006defaf0, RSI=0x0000000000000000, RDI=0x0000000000000000
R8 =0x00000000eb3a4a80, R9 =0x0000000000000000, R10=0x0000000000000000, R11=0x0000000000000001
R12=0x0000000000000000, R13=0x0000000000000000, R14=0x0000000000000000, R15=0x0000000000000000
RIP=0x000000006d90503e, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x0000000006def980)
0x0000000006def980:   00000000066299d0 000000006d4e04c2
0x0000000006def990:   00000000066299d0 00000000066299d0
0x0000000006def9a0:   00000000eb3a4a80 000000006d9dd91e
0x0000000006def9b0:   0000000006defa98 0000000006defa98
0x0000000006def9c0:   000000000662f800 000000006d4d5dcf
0x0000000006def9d0:   0000000006629800 0000000000000000
0x0000000006def9e0:   0000000000000000 0000000000000000
0x0000000006def9f0:   00000000066299d0 0000000000000000
0x0000000006defa00:   0000000000000000 000000006d4c76da
0x0000000006defa10:   0000000006defa98 0000000006defaf0
0x0000000006defa20:   000000000662f800 00000000066299d0
0x0000000006defa30:   00000000066299d0 000000006d31500a
0x0000000006defa40:   0000000000000000 0000000006defed0
0x0000000006defa50:   000000000669b901 000000006d4cea83
0x0000000006defa60:   000000000662c220 000000000662e3f0
0x0000000006defa70:   0000000000000031 00000000066d19a0

Instructions: (pc=0x000000006d90503e)
0x000000006d90501e:   04 48 8b 14 08 45 84 db 48 63 05 b3 1d 6e 00 4a
0x000000006d90502e:   63 34 00 48 63 05 a4 1d 6e 00 46 8b 0c 00 74 16
0x000000006d90503e:   8b 42 08 0f b6 0d f8 41 6c 00 48 d3 e0 48 03 05
0x000000006d90504e:   e6 41 6c 00 eb 04 48 8b 42 08 8b 40 18 25 00 ff


Register to memory mapping:

RAX=0x0000000000000014 is an unknown value
RBX=0x0000000006629800 is a thread
RCX=0x00000000eb3a4a80 is an oop
java.lang.String
- klass: 'java/lang/String'
RDX=0x0000000000000000 is an unknown value
RSP=0x0000000006def980 is pointing into the stack for thread: 0x0000000006629800
RBP=0x0000000006defaf0 is pointing into the stack for thread: 0x0000000006629800
RSI=0x0000000000000000 is an unknown value
RDI=0x0000000000000000 is an unknown value
R8 =0x00000000eb3a4a80 is an oop
java.lang.String
- klass: 'java/lang/String'
R9 =0x0000000000000000 is an unknown value
R10=0x0000000000000000 is an unknown value
R11=0x0000000000000001 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x0000000000000000 is an unknown value


Stack: [0x0000000006cf0000,0x0000000006df0000],  sp=0x0000000006def980,  free space=1022k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x4503e]
C  0x000000000000012c


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x0000000006652000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=59500, stack(0x0000000007420000,0x0000000007520000)]
  0x0000000006640800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=43688, stack(0x0000000007320000,0x0000000007420000)]
  0x000000000663d000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=8336, stack(0x0000000007220000,0x0000000007320000)]
  0x000000000663a800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=58412, stack(0x0000000007090000,0x0000000007190000)]
  0x000000000662d800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=33572, stack(0x0000000006eb0000,0x0000000006fb0000)]
=>0x0000000006629800 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=61396, stack(0x0000000006cf0000,0x0000000006df0000)]
  0x00000000065d7000 JavaThread "Attach Listener" daemon [_thread_blocked, id=49292, stack(0x00000000069c0000,0x0000000006ac0000)]
  0x00000000065d6800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=51992, stack(0x00000000068c0000,0x00000000069c0000)]
  0x000000000032f000 JavaThread "Finalizer" daemon [_thread_blocked, id=17064, stack(0x00000000067c0000,0x00000000068c0000)]
  0x0000000000327000 JavaThread "Reference Handler" daemon [_thread_blocked, id=40292, stack(0x00000000064c0000,0x00000000065c0000)]
  0x000000000022c800 JavaThread "main" [_thread_blocked, id=63312, stack(0x0000000002540000,0x0000000002640000)]

Other Threads:
  0x000000000031f000 VMThread [stack: 0x00000000063c0000,0x00000000064c0000] [id=55608]
  0x0000000006660000 WatcherThread [stack: 0x0000000007520000,0x0000000007620000] [id=7204]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
PSYoungGen      total 18624K, used 640K [0x00000000eb360000, 0x00000000ec820000, 0x0000000100000000)
  eden space 16000K, 4% used [0x00000000eb360000,0x00000000eb400030,0x00000000ec300000)
  from space 2624K, 0% used [0x00000000ec590000,0x00000000ec590000,0x00000000ec820000)
  to   space 2624K, 0% used [0x00000000ec300000,0x00000000ec300000,0x00000000ec590000)
PSOldGen        total 42624K, used 0K [0x00000000c1a00000, 0x00000000c43a0000, 0x00000000eb360000)
  object space 42624K, 0% used [0x00000000c1a00000,0x00000000c1a00000,0x00000000c43a0000)
PSPermGen       total 21248K, used 3034K [0x00000000bc800000, 0x00000000bdcc0000, 0x00000000c1a00000)
  object space 21248K, 14% used [0x00000000bc800000,0x00000000bcaf6898,0x00000000bdcc0000)

Code Cache  [0x0000000002640000, 0x00000000028b0000, 0x0000000005640000)
total_blobs=165 nmethods=2 adapters=125 free_code_cache=49947968 largest_free_block=12096

写不下了,接1楼



作者: toShareBeauty    时间: 2013-7-9 22:43
Dynamic libraries:
0x0000000000400000 - 0x000000000042f000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\bin\javaw.exe
0x0000000077c10000 - 0x0000000077dbc000         C:\Windows\SYSTEM32\ntdll.dll
0x00000000778b0000 - 0x00000000779cf000         C:\Windows\system32\kernel32.dll
0x000007fefdbf0000 - 0x000007fefdc5c000         C:\Windows\system32\KERNELBASE.dll
0x000007feffdc0000 - 0x000007feffe9b000         C:\Windows\system32\ADVAPI32.dll
0x000007feff510000 - 0x000007feff5af000         C:\Windows\system32\msvcrt.dll
0x000007fefe3d0000 - 0x000007fefe3ef000         C:\Windows\SYSTEM32\sechost.dll
0x000007fefddb0000 - 0x000007fefdede000         C:\Windows\system32\RPCRT4.dll
0x0000000077b10000 - 0x0000000077c0a000         C:\Windows\system32\USER32.dll
0x000007fefe310000 - 0x000007fefe377000         C:\Windows\system32\GDI32.dll
0x000007feff940000 - 0x000007feff94e000         C:\Windows\system32\LPK.dll
0x000007fefe3f0000 - 0x000007fefe4ba000         C:\Windows\system32\USP10.dll
0x000007feff4e0000 - 0x000007feff50e000         C:\Windows\system32\IMM32.DLL
0x000007feffcb0000 - 0x000007feffdb9000         C:\Windows\system32\MSCTF.dll
0x000000006d8c0000 - 0x000000006e07c000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\server\jvm.dll
0x000007fefdc60000 - 0x000007fefdc9b000         C:\Windows\system32\WINMM.dll
0x000000006d830000 - 0x000000006d83e000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\verify.dll
0x000000006d450000 - 0x000000006d477000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\java.dll
0x000000006d4c0000 - 0x000000006d4f4000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\jdwp.dll
0x000000006d6e0000 - 0x000000006d6e8000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\npt.dll
0x000000006d880000 - 0x000000006d892000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\zip.dll
0x000000006d310000 - 0x000000006d319000         D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin\dt_socket.dll
0x000007feffed0000 - 0x000007fefff1d000         C:\Windows\system32\WS2_32.dll
0x000007feffec0000 - 0x000007feffec8000         C:\Windows\system32\NSI.dll
0x000007fefbaa0000 - 0x000007fefbab5000         C:\Windows\system32\NLAapi.dll
0x000007fefd1b0000 - 0x000007fefd204000         C:\Windows\System32\mswsock.dll
0x000007fefd030000 - 0x000007fefd08b000         C:\Windows\system32\DNSAPI.dll
0x000007fef7080000 - 0x000007fef708b000         C:\Windows\System32\winrnr.dll
0x000007fef7060000 - 0x000007fef7075000         C:\Windows\system32\napinsp.dll
0x000007fef7000000 - 0x000007fef7019000         C:\Windows\system32\pnrpnsp.dll
0x000007fef6f90000 - 0x000007fef6fa0000         C:\Windows\system32\wshbth.dll
0x000007fefb400000 - 0x000007fefb427000         C:\Windows\system32\IPHLPAPI.DLL
0x000007fefb3f0000 - 0x000007fefb3fb000         C:\Windows\system32\WINNSI.DLL
0x000007fefac20000 - 0x000007fefac73000         C:\Windows\System32\fwpuclnt.dll
0x000007fef78d0000 - 0x000007fef78d8000         C:\Windows\system32\rasadhlp.dll
0x000007fefcab0000 - 0x000007fefcab7000         C:\Windows\System32\wshtcpip.dll
0x0000000077dd0000 - 0x0000000077dd7000         C:\Windows\system32\PSAPI.DLL

VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:12651 -Dfile.encoding=GBK
java_command: cn.itcast.others.StringObjectDemo
Launcher Type: SUN_STANDARD

Environment Variables:
CLASSPATH=.
PATH=D:\Users\vivianZhao\AppData\Local\MyEclipse Professional\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\jre\bin;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;d:\Program Files\MATLAB\R2009b\runtime\win64;d:\Program Files\MATLAB\R2009b\bin;D:\Program Files (x86)\Java\jdk1.7.0_15\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\Java\jdk1.7.0_15\jre;;C:\Program Files (x86)\DBank\ClickUp
USERNAME=vivianZhao
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows 7 , 64 bit Build 7600

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 42 stepping 7, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht

Memory: 4k page, physical 4085932k(464612k free), swap 9718068k(751956k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.14-b01) for windows-amd64 JRE (1.6.0_43-b01), built on Mar  1 2013 01:52:33 by "java_re" with MS VC++ 8.0 (VS2005)

time: Tue Jul 09 22:29:29 2013
elapsed time: 7 seconds
作者: 张承富    时间: 2013-7-10 01:52
童鞋,你火了
作者: changweihua    时间: 2013-7-10 07:30
vivianZhao

jdfw.gif (1.64 MB, 下载次数: 3)

jdfw.gif

作者: toShareBeauty    时间: 2013-7-10 08:39
本帖最后由 toShareBeauty 于 2013-7-10 10:16 编辑
changweihua 发表于 2013-7-10 07:30
vivianZhao

非常感谢 changweihua 同学的回复,这么费心弄成gif的图
你能把你的myeclipse版本的和os版本的信息贴一个图么?我的是 myeclipse 2013 pro windows 64bits 版本



还有为什么你的myeclipse的编辑器视图中,在debug透视图的时候,没有打开 String 的源码,因为到这行用到 String 类,我的会打开 String 源码,然后就 crash 了。就像下图
刚刚我把myeclipse的compiler配置为1.7,把jre 也配置为1.7还是不行,以前我用的是都 myeclipse 自带的1.6.



作者: changweihua    时间: 2013-7-10 09:36
本帖最后由 changweihua 于 2013-7-10 09:49 编辑
toShareBeauty 发表于 2013-7-10 08:39
非常感谢 changweihua 同学的回复,这么费心弄成gif的图
你能把你的myeclipse版本的和os版本的信息贴一个 ...

很抱歉,我用的Eclipse,我刚刚试了下MyEclipse也报错,不过更改下执行环境能执行,但是不进入String类的字节码
作者: toShareBeauty    时间: 2013-7-10 10:20
changweihua 发表于 2013-7-10 09:36
很抱歉,我用的Eclipse,我刚刚试了下MyEclipse也报错,不过更改下执行环境能执行,但是不进入String类的 ...

你选的执行环境是不是配置的jre目录,需要配置jdk目录,应为jre目录下面没有源码的压缩文件
作者: changweihua    时间: 2013-7-10 10:48
toShareBeauty 发表于 2013-7-10 10:20
你选的执行环境是不是配置的jre目录,需要配置jdk目录,应为jre目录下面没有源码的压缩文件 ...

嗯,但是自己设置的执行环境不出错,设置为jdk会进String.class

TM截图20130710104658.png (17.19 KB, 下载次数: 0)

TM截图20130710104658.png

作者: toShareBeauty    时间: 2013-7-11 21:47
changweihua 发表于 2013-7-10 10:48
嗯,但是自己设置的执行环境不出错,设置为jdk会进String.class

我换了个oracle下载的 jdk 还是不行,只用 jre 是没有问题的,可能是 jdb 的问题吧。




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2