Eclipse不断在GDB中发生段错误 [英] Eclipse constantly segfaults in GDB

查看:202
本文介绍了Eclipse不断在GDB中发生段错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在弄清Eclipse为什么会崩溃的时候,我尝试启动eclipse并将GDB附加到eclipse java进程。然而,几乎在我连接GDB并且让它继续下去的时候,几乎在我继续之后,几乎立即出现了不断的段错误。这是它的一部分:

 编程接收到的信号SIGSEGV,分段故障。 
[切换到线程0x7f445879d700(LWP 22968)]
0x00007f445739b3f4来自/usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
的JVM_NewInstanceFromConstructor() gdb)bt
#0 0x00007f445739b3f4 JVM_NewInstanceFromConstructor()from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
#1 0x00007f444d012698 in ?? ()
#2 0x00000000f6031d10 in ?? ()
#3 0x00000000f6031cf8在? ()
#4 0x00007f44587999b0在? ()
#5 0x0000000000000000在?? ()
(gdb)c
继续。
[线程0x7f43​​d2a0f700(LWP 23085)已退出]

编程接收到的信号SIGSEGV,分段错误。
[切换到线程0x7f43​​d211c700(LWP 23111)]
0x00007f44570c86a4在ThreadInVMfromJava ::〜ThreadInVMfromJava()()from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm。所以
(gdb)
继续。

编程接收到的信号SIGSEGV,分段故障。
0x00007f445736e6fc in jni_ReleasePrimitiveArrayCritical()from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
(gdb)
继续。
[线程0x7f43​​d211c700(LWP 23111)退出]

编程接收到的信号SIGSEGV,分段错误。
[切换到线程0x7f43​​d280d700(LWP 23087)]
0x00007f44570c86a4在ThreadInVMfromJava ::〜ThreadInVMfromJava()()from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm。所以
(gdb)
继续。
[New Thread 0x7f43​​d211c700(LWP 23174)]

奇怪的是Eclipse似乎在发生所有这些段错误时继续完美地运行。我没有在Eclipse的错误日志和dmesg中看到任何段错误。有人知道为什么会发生这种情况,为什么Eclipse继续运行,尽管存在段错误,并且它是否需要修复?我也很好奇程序如何继续运行,尽管我收到了段错误,尽管我认为信号处理程序可能会消耗信号并阻止程序退出。

解决方案


奇怪的是,当所有这些段错误都发生时,Eclipse似乎仍然继续运行。


对于任何Java二进制文件(这是Eclipse的一个例子),这是期望的



Java运行时相当复杂,并使用大量的低级技巧。特别是,它会尝试机会地取消引用指针,如果该指针不好,请获取 SIGSEGV ,重新调整信号处理程序中的内容并继续执行。



另见这个答案。


While figuring out why Eclipse has been crashing on me, I tried to start eclipse and attach GDB to the eclipse java process. However, almost as soon as I attached GDB and told it to continue, there has been a constant stream of segfaults, almost immediately after I continue. This is part of it:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f445879d700 (LWP 22968)]
0x00007f445739b3f4 in JVM_NewInstanceFromConstructor () from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
(gdb) bt
#0  0x00007f445739b3f4 in JVM_NewInstanceFromConstructor () from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
#1  0x00007f444d012698 in ?? ()
#2  0x00000000f6031d10 in ?? ()
#3  0x00000000f6031cf8 in ?? ()
#4  0x00007f44587999b0 in ?? ()
#5  0x0000000000000000 in ?? ()
(gdb) c
Continuing.
[Thread 0x7f43d2a0f700 (LWP 23085) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f43d211c700 (LWP 23111)]
0x00007f44570c86a4 in ThreadInVMfromJava::~ThreadInVMfromJava() () from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
(gdb) 
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007f445736e6fc in jni_ReleasePrimitiveArrayCritical () from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
(gdb) 
Continuing.
[Thread 0x7f43d211c700 (LWP 23111) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f43d280d700 (LWP 23087)]
0x00007f44570c86a4 in ThreadInVMfromJava::~ThreadInVMfromJava() () from /usr/java/jdk1.7.0_45/jre/lib/amd64/server/libjvm.so
(gdb) 
Continuing.
[New Thread 0x7f43d211c700 (LWP 23174)]

The strange thing is that Eclipse seems to continue running perfectly fine while all these segfaults are occurring. I do not see any segfaults in Eclipse's error log nor in dmesg. Does anybody know why this is happening, why Eclipse continues running despite the segfaults, and if it is something that needs to be fixed? I am also curious how a program can continue to run despite receiving a segfault, though I assume a signal handler is probably consuming the signal and preventing the program from exiting.

解决方案

The strange thing is that Eclipse seems to continue running perfectly fine while all these segfaults are occurring.

This is expected for any Java binary (which Eclipse is one example of).

Java runtime is quite complicated, and uses multitude of low-level tricks. In particular, it will try to opportunistically dereference a pointer, get a SIGSEGV if that pointer was bad, re-adjust things in a signal handler, and resume execution.

See also this answer.

这篇关于Eclipse不断在GDB中发生段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆