javajvmjvm-hotspotjvm-crashhs-err

What is the meaning of Compilation Events at hs_err_pid file?


I got my JVM crash and the stack trace at the generated hs_err_pid file is pointing to some method. Now, I see that the same method also exist in the a lower sub-section (under Process section) named "Compilation events".

  1. What is the meaning of this section?
  2. What can I understand from the fact that the JVM crashed in that specific place which is pointed also in the Compilation events section?

Below is relevant prints from the hs_err_pid file. See computePath 0x00007f07d4434960 at both sections.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f07d44359f6, pid=1, tid=0x00007f07acc30700
#
# JRE version: OpenJDK Runtime Environment (8.0_151-b12) (build 1.8.0_151-8u151-b12-1~deb9u1-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.151-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 17451 C2 com.mycompany.myproject.pf.service.PathComputationServiceBean.computePath(Lorg/jgrapht/GraphPath;)Lcom/mycompany/myproject/pf/model/ComputedPath; (972 bytes) @ 0x00007f07d44359f6 [0x00007f07d4434960+0x1096]
#
# Core dump written. Default location: /application/core or core.1
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
.
.
.
Compilation events (10 events):
Event: 77730.233 Thread 0x00007f07e018f000 17446       3       sun.net.www.http.KeepAliveCache$1::run (5 bytes)
Event: 77730.234 Thread 0x00007f07e018f000 nmethod 17446 0x00007f07d3c53010 code [0x00007f07d3c53180, 0x00007f07d3c53328]
Event: 77731.883 Thread 0x00007f07e018d800 17448   !   4       java.util.concurrent.ThreadPoolExecutor::getTask (179 bytes)
Event: 77731.890 Thread 0x00007f07e018d800 nmethod 17448 0x00007f07d3c47a10 code [0x00007f07d3c47be0, 0x00007f07d3c48210]
Event: 77901.463 Thread 0x00007f07e018f000 17449       3       sun.net.www.http.ClientVector::<init> (10 bytes)
Event: 77901.464 Thread 0x00007f07e018f000 nmethod 17449 0x00007f07d1976e90 code [0x00007f07d1977020, 0x00007f07d19772e8]
Event: 77963.888 Thread 0x00007f07e018f000 17450       3       sun.net.www.http.KeepAliveCache$1::<init> (15 bytes)
Event: 77963.888 Thread 0x00007f07e018f000 nmethod 17450 0x00007f07d1fbde50 code [0x00007f07d1fbdfc0, 0x00007f07d1fbe1b0]
Event: 78214.567 Thread 0x00007f07e018d800 17451       4       com.mycompany.myproject.pf.service.PathComputationServiceBean::computePath (972 bytes)
Event: 78214.857 Thread 0x00007f07e018d800 nmethod 17451 0x00007f07d44340d0 code [0x00007f07d4434960, 0x00007f07d44400a8]

Solution

  • The "Compilation events" shows which methods have been recently compiled from Java bytecode to native code. If you consistently see a crash within the same method, this may mean that the JVM version you're currently using is compiling this method incorrectly.

    In case of any native crash, the first thing you need to do is to upgrade your JVM to the latest version. If this does not help, you can try rewriting the problematic method (simplifying its logic, breaking it into smaller methods, etc.), and this could help avoid the crash.