2

我的 JVM 崩溃了,生成的 hs_err_pid 文件中的堆栈跟踪指向某个方法。现在,我看到相同的方法也存在于名为“编译事件”的较低子部分(在 Process 部分下)中。

  1. 这部分的意义是什么?
  2. 从 JVM 在编译事件部分中也指出的特定位置崩溃这一事实我能理解什么?

下面是来自 hs_err_pid 文件的相关打印。请参阅两个部分的computePath 0x00007f07d4434960

#
# 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]
4

2 回答 2

2

“编译事件”显示最近哪些方法已从 Java 字节码编译为本机代码。如果您始终在同一方法中看到崩溃,这可能意味着您当前使用的 JVM 版本错误地编译了此方法。

如果发生任何本机崩溃,您需要做的第一件事是将 JVM 升级到最新版本。如果这没有帮助,您可以尝试重写有问题的方法(简化其逻辑,将其分解为更小的方法等),这有助于避免崩溃。

于 2018-02-25T11:24:59.023 回答
1

如果它在同一个方法中反复崩溃并且没有要下载的 JVM 版本,则可以从编译中排除该方法。

请参阅“5.2.1 解决 HotSpot 编译器线程或编译代码中的崩溃问题” https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/crashes002.html

于 2018-02-27T00:13:21.373 回答