gpt4 book ai didi

java - JVM 在没有指定帧的情况下崩溃,只有 "timer expired, abort"

转载 作者:可可西里 更新时间:2023-11-01 14:15:11 26 4
gpt4 key购买 nike

我正在 Hadoop 下运行一个 Java 作业,它导致 JVM 崩溃。我怀疑这是由于某些 JNI 代码造成的(它使用 JBLAS 和多线程 native BLAS 实现)。然而,虽然我希望崩溃日志为调试提供“有问题的框架”,但日志看起来像:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f204dd6fb27, pid=19570, tid=139776470402816
#
# JRE version: 6.0_38-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.13-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# # [ timer expired, abort... ]

JVM 是否有一些计时器来确定在生成此故障转储输出时要等待多长时间?如果是这样,有没有办法增加时间,以便我可以获得更多有用的信息?我不认为所提及的计时器来自 Hadoop,因为我在许多未提及 Hadoop 的地方看到(无用的)对此错误的引用。

Google 似乎显示字符串“timer expired, abort”仅出现在这些 JVM 错误消息中,因此它不太可能来自操作系统。

编辑:看来我可能运气不好。来自 ./hotspot/src/share/vm/runtime/thread.cpp
在OpenJDK版本的JVM源码中:

 if (is_error_reported()) {
// A fatal error has happened, the error handler(VMError::report_and_die)
// should abort JVM after creating an error log file. However in some
// rare cases, the error handler itself might deadlock. Here we try to
// kill JVM if the fatal error handler fails to abort in 2 minutes.
//
// This code is in WatcherThread because WatcherThread wakes up
// periodically so the fatal error handler doesn't need to do anything;
// also because the WatcherThread is less likely to crash than other
// threads.

for (;;) {
if (!ShowMessageBoxOnError
&& (OnError == NULL || OnError[0] == '\0')
&& Arguments::abort_hook() == NULL) {
os::sleep(this, 2 * 60 * 1000, false);
fdStream err(defaultStream::output_fd());
err.print_raw_cr("# [ timer expired, abort... ]");
// skip atexit/vm_exit/vm_abort hooks
os::die();
}

// Wake up 5 seconds later, the fatal handler may reset OnError or
// ShowMessageBoxOnError when it is ready to abort.
os::sleep(this, 5 * 1000, false);
}
}

等待两分钟似乎是硬编码的。为什么我的工作的崩溃报告花费的时间比这更长,我不知道,但我认为这个问题至少已经得到了回答。

最佳答案

看来我可能运气不好。来自 JVM 源的 OpenJDK 版本中的 ./hotspot/src/share/vm/runtime/thread.cpp:

 if (is_error_reported()) {
// A fatal error has happened, the error handler(VMError::report_and_die)
// should abort JVM after creating an error log file. However in some
// rare cases, the error handler itself might deadlock. Here we try to
// kill JVM if the fatal error handler fails to abort in 2 minutes.
//
// This code is in WatcherThread because WatcherThread wakes up
// periodically so the fatal error handler doesn't need to do anything;
// also because the WatcherThread is less likely to crash than other
// threads.

for (;;) {
if (!ShowMessageBoxOnError
&& (OnError == NULL || OnError[0] == '\0')
&& Arguments::abort_hook() == NULL) {
os::sleep(this, 2 * 60 * 1000, false);
fdStream err(defaultStream::output_fd());
err.print_raw_cr("# [ timer expired, abort... ]");
// skip atexit/vm_exit/vm_abort hooks
os::die();
}

// Wake up 5 seconds later, the fatal handler may reset OnError or
// ShowMessageBoxOnError when it is ready to abort.
os::sleep(this, 5 * 1000, false);
}
}

等待两分钟似乎是硬编码的。为什么我的工作的崩溃报告花费的时间比这更长,我不知道,但我认为这个问题至少已经得到了回答。

关于java - JVM 在没有指定帧的情况下崩溃,只有 "timer expired, abort",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20427361/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com