When a fatal error occurs, the JVM generates a file such as Hs_err_pid<pid>.log, which often contains important information about the cause of the virtual machine crash. Since often encountered, in this article, I picked one, and analyzed the contents of it each paragraph (files can be downloaded at the end of the article). By default, files are created in the working directory (the JVM attempts to write files to a temporary directory such as/tmp if no permissions are created), and of course, the file format and path can also be specified by parameters such as: java-xx:errorfile=/var/log/java/ Java_error%p.log This file will include:
- An operation exception or signal that triggers a fatal error;
- Version and configuration information;
- Thread details and line stacks that trigger a fatal exception;
- The list of currently running threads and their status;
- Aggregate information of the heap;
- the loaded local library;
- command-line arguments;
- environment variables;
- Detailed information about the operating system CPU.
First, you see a summary of the problem: # SIGSEGV (0XB) at PC=0X03568CF4, pid=16819, tid=3073346448 An unexpected error was detected by the JRE, where:
- SIGSEGV is the signal name
- 0XB is the letter number
- PC=0X03568CF4 refers to the value of the program counter
- pid=16819 is the process number
- tid=3073346448 is the thread number
If you have a knowledge of the JVM, you should not be unfamiliar with these things. Next is the version information for the JRE and JVM: # JRE version:6.0_32-b05 # Java Vm:java HotSpot (TM) Server VM (20.7-b02 mixed mode linux-x86) running in mixed mode Type. Then there is the problem frame information: # Problematic frame: # C [LIBGTK-X11-2.0.SO.0+0X19FCF4] __float128+0x19fcf4
- C: The frame type is a local frame, and the type of the frame includes:
- C: local C-Frame
- J: Explanation of the Java frame
- V: Virtual Machine frame
- V: Stub stack frame generated by virtual machine
- J: Other frame types, including compiled Java frames
- LIBGTK-X11-2.0.SO.0+0X19FCF4: The same as the program counter (PC), but with the local so library + offset method.
Then the first part is the thread information: current thread (0X09F30C00): Javathread "Main" [_thread_in_native, id=16822, Stack (0xb72a8000,0xb72f9000 )] The current thread:
- 0x09f30c00: pointer
- javathread: Thread type, possible types include:
- javathread
- vmthread
- Compi Lerthread
- gctaskthread
- watcherthread
- concurrentmarksweepthread
- Main: First name
- _thread_in_native: Thread Current state, state enumeration includes:
- _thread_uninitialized: The thread has not yet been created, it only appears when memory causes are crashing
Li>_thread_new: The thread has been created, but the
- _thread_in_native is not started: The thread is executing local code, which is most likely a problem with local code
- _thread_in_ VM: Thread executing virtual machine code
- _thread_in_java: Thread is performing an explanation or compiled Java code
- _thread_blocked: Thread is blocking state
- ... _trans: _trans end, thread is in an intermediate state to switch to another State
- id=16822: Thread ID
- 0xb72a8000,0xb72f9000: Stack interval
Siginfo:si_signo=sigsegv:si_errno=0, Si_code=1 (segv_maperr), si_addr=0x00000010 This part is an unexpected signal message that causes the virtual machine to terminate, meaning it has been roughly mentioned before. Where Si_errno and Si_code are used to identify anomalies under Linux, Windows is a exceptioncode. eax=0x00000000, ebx=0x0375dd84, ecx=0x00000000, edx=0x00000000 esp=0xb72f0fa0, Ebp=0xb72f0fb8, ESI=0x00000000, EDI= 0x0a6c1800 eip=0x03568cf4, eflags=0x00010246, cr2=0x00000010 This is the register context. Top of Stack: (sp=0xb72f0fa0) 0xb72f0fa0: 00000000 00402250 0040217f 0375dd84 0xb72f0fb0: 00000000 0a6c1800 b72f0fe8 0356c2c0 0xb72f0fc0: 00000000 0a6c1800 b72f0fe8 003b3e77 0xb72f0fd0: 003e6c8b 0a1a70d0 0a193358 0375dd84 0xb72f0fe0: 0a276418 0a276418 b72f1048 03536c56 0xb72f0ff0: 0acad000 0b3ca978 0000000c 00dd0674 0xb72f1000: 00000003 0a2c7d50 b72f1038 0000330c 0xb72f1010: FFFFFFFF ffffffff 00000001 00000001 Instructions: (PC=0X03568CF4) 0x03568cd4: 89-F8 7d FC D6 C7 E8 7e 1b 0x03568ce4: ea FF 89 D4, E8, EA FF 0x03568cf4: 8b, 3c, C7, and the 0x03568d0 of the XX. 4: d0 (8b), the operation code next to the top program counter of the E8 DD stack, they can be disassembled into the instructions executed before the system crashes. Register to Memory mapping:eax=0x00000000 are an unknown value ebx=0x0375dd84: <offset 0x394d84> in/usr/lib/libgtk- x11-2.0.so.0 at 0x033c9000 ecx=0x00000000 are an unknown value edx=0x00000000 are an unknown value esp=0xb72f0fa0 is Pointin G into the stack for thread:0x09f30c00 Ebp=0xb72f0fb8 are pointing into the stacks for thread:0x09f30c00 esi=0x00000000 are An unknown value edi=0x0a6c1800 are an unknown value register and memory mapping information. Stack: [0xb72a8000,0xb72f9000], sp=0xb72f0fa0, free space=291k Native Frames: (J=compiled Java Code, j=interpreted, VV=VM Code, c=native code) c [libgtk-x11-2.0.so.0+0x19fcf4] __float128+ 0X19FCF4 c [libgtk-x11-2.0.so.0+0x1a32c0] __float128+0xc0 ... C [libswt-pi-gtk-3738.so+0X33F6A]&NBSP;&NBSP;JAVA_ORG_ECLIPSE_SWT_INTERNAL_GTK_OS__1CALL+0XF j Org.eclipse.swt.internal.gtk.os._call (iii) I J org.eclipse.swt.internal.gtk.os.call (iii) I Java frames: ( j=compiled Java Code, j=interpreted, VV=VM Code) j org.eclipse.swt.internal.gtk.os._call (III) I J org.eclipse.swt.internal.gtk.os.call (III) I j Org.eclipse.swt.widgets.Widget.fixedSizeAllocateProc (II) i+5 j Org.eclipse.swt.widgets.Display.fixedSizeAllocateProc (II) i+17 v ~stubroutines::call_stub line stacks. Contains the address, stack top, stack counter and thread unused stack information, because the stack may be very long, the length of the print is limited, but at least the local stack and the Java stack are printed (many times the local stack can not print, but the Java stack is usually printed out). As you can see, Eclipse's virtual machine crashes. Ava Threads: (= = current thread) 0x0b4c1000 javathread "Worker-247" [_thread_blocked, id=25417, Stack (0x7 41bc000,0x7420d000)] 0x0a300c00 javathread "Worker-246" [_thread_blocked, id=25235, Stack (0x7d30c000, 0x7d35d000)] ... Thread information. At a glance, not explained. VM State:not at SafePoint (normal execution) virtual machine state. Including:
- not at a safepoint: normal operating State;
- at SafePoint: All threads are blocked due to virtual machine wait state, waiting for a virtual machine operation to complete;
- Synchronizing: A special virtual machine operation that requires other threads within the virtual machine to remain in a wait state.
VM Mutex/monitor currently owned by a Thread:none the virtual machine's Mutex and Monitor are not currently held by threads. A mutex is a lock inside a virtual machine, and monitor is associated with a Java object. heap psyounggen total 149056K, used 125317K [0xa9700000, 0xb41a0000, 0xb41a0000) & nbsp eden space 123520K, 95% used [0xa9700000,0xb0ac0de0,0xb0fa0000] from space 25536K, 26% used [0xb28b0000 , 0xb2f50748,0xb41a0000) to space 25600K, 0% used [0xb0fa0000,0xb0fa0000,0xb28a0000] PSOldGen total 261248K, used 239964K [0x941a0000, 0xa40c0000, 0xa9700000) & nbsp object space 261248K, 91% used [0x941a0000,0xa2bf7018,0xa40c0000] PSPermGen Total 163328K, used 130819K [0x841a0000, 0x8e120000, 0x941a0000) object space 163328K, 80% used [0x841a 0000,0x8c160c40,0x8e120000) heap information. New generation, Laosheng generation, permanent generation. Those who know about the JVM should be clear and do not explain. Code cache [0xb4262000, 0xb5ac2000, 0xb7262000) total_blobs=5795 nmethods=5534 adapters=209 free_code_cache=25103616 largest_free_block=38336 Code cache. This is a piece of memory for compiling and saving local code, note that it is local code, it is not the same as PermGen (permanent generation), and the permanent band is used to store the Java class definition. Dynamic libraries:00101000-00122000 R-xp 00000000 08:01 3483560 /usr/lib/libjpeg.so.62.0.0 00122000-00123000 rwxp 00020000 08:01 3483560 /usr/lib/libjpeg.so.62.0.0 00125000-00130000 R-XP 00000000 08 : 9093202 /lib/libgcc_s-4.1.2-20080825.so.1 00130000-00131000 rwxp 0000a000 08:01 9093202 / Lib/libgcc_s-4.1.2-20080825.so.1 ... Memory-mapped. This information is the virtual memory list area when the virtual machine crashes. When locating the cause of the crash, it can tell you which libraries are being used, where they are located, and the stack and Guardian page information. Take the first article in the list as an example:
- 00101000-00122000: Memory Area
- R-XP: Permissions, r/w/x/p/s respectively read/write/execute/private/shared
- 00000000: Offset within the file
- 08:01: Majorid and Minorid of file locations
- 3483560: Index Node number
- /usr/lib/libjpeg.so.62.0.0: File location
Each lib has two pieces of virtual memory area-code and data, their permissions are different, the code area is r-xp; The data area is RWXP. The Guard page is comprised of a pair of--XP and RWXP permissions. VM Arguments:jvm_args:-dosgi.requiredjavaversion=1.5-xx:maxpermsize=256m-xms40m-xmx512m- Dorg.eclipse.swt.browser.xulrunnerpath= ' Java_command:/.../eclipse/plugins/org.eclipse.equinox.launcher_1.2.0. V20110502.jar-os linux-ws gtk-arch x86-showsplash-launcher/.../eclipse/eclipse-name eclipse ... Launcher Type:sun_standard Environment variables:path= ... display=:0.0 Virtual machine parameters and environment variables. Signal HANDLERS:SIGSEGV: [libjvm.so+0x726440], Sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 sigbus: [libjvm.so+ 0X726440], Sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 ... The signal handle. For the signaling mechanism under Linux, see Wiki Encyclopedia,links。 os:red Hat Enterprise Linux Client Release 5.4 (tikanga) unameinux 2.6.18-164.el5 #1 SMP Tue 15:51:54 EDT i686 LIBC:GLIBC 2.5 NPTL 2.5 rlimit:stack 10240k, CORE 0k, Nproc 65536, Nofile 1024x768, as Infinity load average:1.78 1.58 1.54 /proc/meminfo: ... Cpu:total 4 (4 cores per CPU, 1 threads per core) Family 6 model stepping 7, Cmov, cx8, FXSR, MMX, SSE, SSE2, SSE3, SSS E3/proc/cpuinfo: ... memory:4k page, physical 3631860k (155144k free), swap 5124724k (5056452k free) |