JVM Crash的几个实例

最近遇到几个JVM Crash的实例,一共三起,其中一起确定原因,也解决了,其它的还只能猜测可能的原因!

一、JVM 运行一段时间之后突然Crash,生成的hs_err_pid.log文件部分内容如下:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00002b42ca9e64f0, pid=14881, tid=1092757824
#
# JRE version: 6.0_18-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0-b13 mixed mode linux-amd64 )
# Problematic frame:
# V  [libjvm.so+0x5c04f0]
#
# 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 (0x00000000499ee800):  JavaThread "CompilerThread0" daemon [_thread_in_native, id=14905, stack(0x0000000041122000,0x0000000041223000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x000000000000002c

Registers:
RAX=0x00002aab2ab21f40, RBX=0x0000000000000183, RCX=0x00002aab2a097e90, RDX=0x0000000000000008
RSP=0x000000004121e898, RBP=0x000000004121ead0, RSI=0x00002aab29f6d8c0, RDI=0x0000000000000000
R8 =0x0000000000001098, R9 =0x00002aab29373da0, R10=0x00002aab28eb06a0, R11=0x00002aab2ab21f70
R12=0x000000004121f798, R13=0x0000000000000052, R14=0x0000000000000000, R15=0x00002aab2a9e2ff0
RIP=0x00002b42ca9e64f0, EFL=0x0000000000010202, CSGSFS=0x000000000000e033, ERR=0x0000000000000004

通过google,推测可能是JVM的一个bug,但不能确定:http://www.oracle.com/technetwork/java/javase/crashes-137240.html#gbyzd

二、JVM运行一段时间之后突然Crash,生成的hs_err_pid.log文件如下:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00002b624490ac98, pid=2191, tid=1107622208
#
# JRE version: 6.0_18-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x5e9c98]
#
# 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 (0x000000004b8c4000):  GCTaskThread [stack: 0x0000000000000000,0x0000000000000000] [id=2197]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=128 (), si_addr=0x0000000000000000

Registers:
RAX=0x000000000d0e8cad, RBX=0x0000000789ddf538, RCX=0xf13bc057f13bc04c, RDX=0x0000000000000001
RSP=0x000000004204e820, RBP=0x000000004204e880, RSI=0x00002aaac0cf7120, RDI=0x000000004b8caf40
R8 =0xf13bc057f13bc04e, R9 =0x00000007d96af400, R10=0x0000000000000010, R11=0x0000000000000011
R12=0x0000000000000000, R13=0x000000000d0e8cad, R14=0x000000004b8caf40, R15=0xf13bc057f13bc04e
RIP=0x00002b624490ac98, EFL=0x0000000000010282, CSGSFS=0x0000000000000033, ERR=0x0000000000000000
  TRAPNO=0x000000000000000d
……
Heap
 par new generation   total 471872K, used 435920K [0x0000000770000000, 0x0000000790000000, 0x0000000790000000)
  eden space 419456K, 100% used [0x0000000770000000, 0x00000007899a0000, 0x00000007899a0000)
  from space 52416K,  31% used [0x000000078ccd0000, 0x000000078dce4000, 0x0000000790000000)
  to   space 52416K,  74% used [0x00000007899a0000, 0x000000078bfcff20, 0x000000078ccd0000)
 concurrent mark-sweep generation total 1572864K, used 1223031K [0x0000000790000000, 0x00000007f0000000, 0x00000007f0000000)
 concurrent-mark-sweep perm gen total 262144K, used 67047K [0x00000007f0000000, 0x0000000800000000, 0x0000000800000000)
通过google,推测可能是JVM的一个bug,但因为不能稳定重现,也不能确定: http://bugs.sun.com/view_bug.do?bug_id=6896647


三、jboss启动时,提示段错误,然后进程就crash了,在目录下生成了core.pid文件。

之前一直没有core.pid文件生成,折腾了比较久,启动时通过jmx连接来看,在crash之前的CPU和内存均看不出异常,而且crash了之后什么信息也没留下,因此一愁莫展!

后来有一位同学经过一阵努力,使得它可以在crash之前生成core.pid文件了,这个文件生成的head dump文件没看出异常,但是生成的堆栈信息里有一个堆栈长度特别长,联想到我们的-Xss=256k参数,以及之前由于这个参数出现过内存溢出现象。于是将这个参数改为1024k解决问题!具体原因见:

http://www.oracle.com/technetwork/java/javase/crashes-137240.html#gbyzz

对于core.pid文件,有几种方法可以分析:1.可以通过jmap生成heap dump文件;2.可以使用jstack查看crash时的堆栈信息;3.可以使用gdb查看crash时正在执行的代码等等。

你可能感兴趣的:(JVM Crash的几个实例)