11. #
crash了
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002add2265d648, pid=2188, tid=1078282560
#
# JRE version: 6.0_30-b12
# Java VM: OpenJDK (Taobao) 64-Bit Server VM (20.0-b12-internal-fastdebug
mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0xd05648] Unsafe_SetNativeInt+0xb8
#
# An error report file with more information is saved as:
# /home/sajia/hs_err_pid2188.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Current thread is 1078282560
Dumping core ...
Aborted (core dumped) 有打出core dump,
位置通常在“当前工作目录”
12. #
crash了但没core dump
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002b4fb5a7a648, pid=20190, tid=1084868928
#
# JRE version: 6.0_30-b12
# Java VM: OpenJDK (Taobao) 64-Bit Server VM (20.0-b12-internal-fastdebug
mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0xd05648] Unsafe_SetNativeInt+0xb8
#
# An error report file with more information is saved as:
# /home/sajia/hs_err_pid20190.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
没打出core dump。
#
如需要core dump,请确认:
Current thread is 1084868928
Dumping core ... 1、ulimit -c unlimited
Aborted 2、该Java进程对“当前工作
目录”有写权限
3、磁盘剩余空间充足
13. 被OOM Killer干掉了
$ sudo cat /var/log/messages | grep -i "killed process"
Aug 30 15:51:54 testmachine kernel: : Out of memory:
Killed process 15605 (java).
这种情况下既不会有crash
log也不会有core dump
23. 1. 观察crash log
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002aaf0d11c031, pid=28522, tid=1104951616
错误类型:
SIGSEGV
24. 1. 观察crash log
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002aaf0d11c031, pid=28522, tid=1104951616
出错时的程序指针的值:
(该线程执行到哪里了?)
0x00002aaf0d11c031
25. 1. 观察crash log
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002aaf0d11c031, pid=28522, tid=1104951616
出错的进程的ID:
28522
26. 1. 观察crash log
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002aaf0d11c031, pid=28522, tid=1104951616
这个可以忽略
27. 1. 观察crash log
--------------- T H R E A D ---------------
Current thread (0x0000000052109000): JavaThread "CompilerThread1"
daemon [_thread_in_native, id=28538,
stack(0x0000000041cc3000,0x0000000041dc4000)]
出错的线程在HotSpot VM里的
C++层Thread对象的地址:
0x0000000052109000
28. 1. 观察crash log
--------------- T H R E A D ---------------
Current thread (0x0000000052109000): JavaThread "CompilerThread1"
daemon [_thread_in_native, id=28538,
stack(0x0000000041cc3000,0x0000000041dc4000)]
出错的线程的类型:
JavaThread
29. 1. 观察crash log
--------------- T H R E A D ---------------
Current thread (0x0000000052109000): JavaThread "CompilerThread1"
daemon [_thread_in_native, id=28538,
stack(0x0000000041cc3000,0x0000000041dc4000)]
出错的线程的名字(如果有):
CompilerThread1
30. 1. 观察crash log
--------------- T H R E A D ---------------
Current thread (0x0000000052109000): JavaThread "CompilerThread1"
daemon [_thread_in_native, id=28538,
stack(0x0000000041cc3000,0x0000000041dc4000)]
出错的线程的状态:
_thread_in_native
31. 1. 观察crash log
--------------- T H R E A D ---------------
Current thread (0x0000000052109000): JavaThread "CompilerThread1"
daemon [_thread_in_native, id=28538,
stack(0x0000000041cc3000,0x0000000041dc4000)]
出错的线程的ID:
28538
32. 1. 观察crash log
--------------- T H R E A D ---------------
Current thread (0x0000000052109000): JavaThread "CompilerThread1"
daemon
[_thread_in_native, id=28538, stack(0x0000000041cc3000,0x0000000041d
c4000)]
出错的线程的调用栈
在内存中的地址范围:
(0x0000000041cc3000,
0x0000000041dc4000)
37. 1. 观察crash log
Stack: [0x0000000041cc3000,0x0000000041dc4000], sp=0x0000000041dbd480, free
space=1001k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x593031]
V [libjvm.so+0x592cf2]
V [libjvm.so+0x590001]
V [libjvm.so+0x2d5bc2]
V [libjvm.so+0x2d2cbc]
V [libjvm.so+0x25b0de]
V [libjvm.so+0x2dc468]
V [libjvm.so+0x2dbd6e]
V [libjvm.so+0x72d159]
V [libjvm.so+0x7268c1]
V [libjvm.so+0x623e1f]
native级别的调用栈记录
老JDK6上libjvm.so里的符号不会显示,
JDK6u25或更高版本则会显示
38. 1. 观察crash log
// First letter indicates type of the frame:
// J: Java frame (compiled)
// j: Java frame (interpreted)
// V: VM frame (C/C++)
// v: Other frames running VM generated code (e.g.
stubs, adapters, etc.)
// C: C/C++ frame
39. 1. 观察crash log
Stack: [0x0000000041cc3000,0x0000000041dc4000], sp=0x0000000041dbd480, free
space=1001k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x593031]
V [libjvm.so+0x592cf2]
V [libjvm.so+0x590001]
V [libjvm.so+0x2d5bc2]
V [libjvm.so+0x2d2cbc]
V [libjvm.so+0x25b0de]
V [libjvm.so+0x2dc468]
V [libjvm.so+0x2dbd6e]
V [libjvm.so+0x72d159]
V [libjvm.so+0x7268c1]
V [libjvm.so+0x623e1f]
有些crash log里,
后面还会有Java级别的栈帧
60. 3. 连续在不固定位置遇到native
OutOfMemoryError
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 4092 bytes for char in
/BUILD_AREA/jdk6_24/hotspot/src/share/vm/utilities/stack.inline.hpp. Out of
swap space?
#
# Internal Error (allocation.inline.hpp:39), pid=15553, tid=1325374352
# Error: char in
/BUILD_AREA/jdk6_24/hotspot/src/share/vm/utilities/stack.inline.hpp
62. 3. 连续在不固定位置遇到native
OutOfMemoryError
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 4092 bytes for char
in /BUILD_AREA/jdk6_32/hotspot/src/share/vm/utilities/stack.inline.hpp
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (allocation.inline.hpp:44), pid=16388,
tid=1325312912