Android的应用程序崩溃与SIGABRT信号6只,而Eclipse的调试应用程序、信号、Android、Eclipse

2023-09-03 22:55:47 作者:哭累了休息一會再哭

我有运行完全正常的设备上未安装调试器的应用程序。不过,我有一个问题在Eclipse中调试的时候:

I have an app that runs perfectly fine on a device without a debugger attached. However, I have a problem when debugging in Eclipse:

当主线程,主线程抛出一个SIGABRT,从libc中显然未来(遇到断点后为例)暂停约10秒钟以上。的

唯一的解释我能想到的是,在主线程的消息队列中,当不被轮询,充满着邮件从另一个线程来了。不过,我没有看到堆在主线程被挂起增长。此外,虽然我的应用程序拥有所有的服务,内容提供商,广播接收器,http和地图工作线程,等大约20个线程,我真的不能相信任何过分的消息的来源。

The only explanation I could think of is that the message queue on the main thread, when not being polled, is overflowing with messages coming from another thread. However, I don't see the heap growing when the main thread is suspended. Moreover, while my app has about 20 threads between all services, content providers, broadcast receivers, http and map worker threads, etc., I can't really think of a source of any excessive messages.

我的问题是:我该如何解决这个问题?我可以使用什么样的工具?我如何去寻找是什么原因造成我的应用程序崩溃,而在调试会议暂停?

So my question is: How do I fix this problem? What tools can I use and how do I go about finding what is causing my app to crash while sitting suspended in the debugger?

修改1:

在logcat中唯一的一点是:

The only thing in logcat is:

02-05 22:23:54.861: I/dalvikvm(26795): threadid=3: reacting to signal 3
02-05 22:23:54.901: D/dalvikvm(26795): threadid=1: still suspended after undo (sc=1 dc=1)
02-05 22:23:54.901: I/dalvikvm(26795): Wrote stack traces to '/data/anr/traces.txt'
02-05 22:23:58.905: A/libc(26795): Fatal signal 6 (SIGABRT) at 0x000002f5 (code=0), thread 26795 (om.myapp)

编辑2:

进一步的调查使我相信它的是Android故意杀人,因为它错误地认为UI线程被挂起我的过程。这个问题是不是在我的应用程序。所以,现在我的问题是:如何阻止机器人杀死我的过程,而调试。

Further investigation leads me to believe it is android intentionally killing my process because it mistakenly thinks the UI thread is hung. The problem is NOT in my app. So now my question is: How do I stop Android from killing my process while debugging?

推荐答案

Android的故意杀害,因为它认为UI线程被挂起,所以它的一个ANR权的过程。 用于调试的目的就可以了,

android intentionally kills the process because it thinks the UI thread is hung, so its a ANR right. for debugging purposes you can,

进入设置 - >开发者选项,并选中显示所有ANRS

Go to Settings -> Developer options and check Show all ANRs.

这将显示在后台运行的应用程序的应用程序不响应对话框。您可以点击等待按钮,在对话框中以prevent系统杀死你的过程,直到调试程序连接。 需要注意的是自动打开在前台运行的应用程序的对话框。对于后台应用程序,您必须启用该选项

This will show an App Not Responding dialog for apps running in the background. You can click the Wait button in the dialog to prevent the system from killing your process until the debugger attaches. Note that the dialog is opened automatically for apps running in the foreground. For background apps, you have to enable this option