Android app crashes with SIGABRT 6 only when debugging Eclipse

I have an application that works fine on a device without a debugger attached. However, I have a problem while debugging in Eclipse:

When the main thread is suspended for 10 seconds or more (for example, after hitting a breakpoint), the main thread issues a SIGABRT, apparently coming from libc.

The only explanation I could think of is that the message queue in the main thread, when polling is not performed, is full of messages coming from another thread. However, I do not see how the heap grows when the main thread is suspended. Moreover, although my application has about 20 threads between all services, content providers, broadcast receivers, HTTP and map workflows, etc., I cannot really think about the source of any excessive messages.

So my question is: how do I fix this problem? What tools can I use and how can I find what causes my application to crash while waiting for a suspension in the debugger?

Change 1:

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) 

Edit 2:

Further research leads me to believe that the android intentionally kills my process, because it mistakenly believes that the user interface thread is hanging. The problem is not in my application. So now my question is: how to stop Android from killing my process during debugging?

+43
android eclipse sigabrt
Feb 06 '14 at 6:38
source share
3 answers

android intentionally kills the process because it believes that the user interface thread is hanging, therefore its ANR is right. for debugging purposes, you can,

Go to Settings → Developer Options and select the Show all ANR check box.

The App Not Responseing dialog box for applications running in the background appears. You can click the "Wait" button in the dialog box so that the system does not kill your process before the debugger is prefixed. Please note that the dialog opens automatically for applications running in the foreground. For background applications you must enable this option.

+22
Jun 29 '14 at 14:25
source share

It started with me in android 7.1.1

When connecting the debugger, my application always crashed, the same thing when the application was launched in debug mode.

What fixed for me is simple:

  • Run the application
  • Click "Disable Breakpoints" in Debug
  • Attach a debugger
  • Press "Mute Breakpoints" again to enable the function.
  • Done, debugging again
+3
Jan 10 '17 at 22:45
source share

I had similar problems, but what Sam suggested did not help - I had to FOUND to remove the breakpoints, and then it worked for me.

0
Oct 13 '17 at 20:14
source share



All Articles