61

Im new to android development my app gets constantly killed when switching 11 times from activity and than it only says

Fatal signal 6 (SIGABRT), code -6 in tid 9485 (Thread-141585)

in my logcat.

What does this mean?

Stefan van de Laarschot
  • 2,154
  • 6
  • 30
  • 50
  • 3
    This will occur if there is a CPU intensive operation happening in UI thread. Can you share Activity code to check if there is anything like that – Sreeraj Apr 18 '16 at 12:26
  • I'm not entirely sure, but I think it gives that error when your Android device thinks the UI (is about to) hang. So you most likely do a bit too much on the UI-thread, as correctly pointed out by _@Sreeraj_. Also, does this only occur while debugging? If so, try [turning on the ANR (App Not Responding) dialog](http://stackoverflow.com/a/24476963/1682559) so it will Wait a bit for the debugger to start. The main problem is memory on the UI Thread, what causes it however is just guessing without some more information like some of your code-snippets and such. – Kevin Cruijssen Apr 18 '16 at 12:32
  • Im using a BluetoothLeService (Service) class wich i bind and unbind on every activity when i switch for like 11 times it crashes my app with the Signal 6 error also turned ANR already on it just crash my app – Stefan van de Laarschot Apr 18 '16 at 12:34

2 Answers2

37

Without more details (like seeing some code).

1) Do not block the UI thread, this can cause a SIGABRT as the OS will kill a non-responsive app.

bind and unbind on every activity when i switch for like 11 times it crashes my app

2) Make sure that in your OnDestroy within your Activity you are cleaning up after yourself. i.e. Removing all your Listeners/Events and then calling the Base.OnDestory.

3) An external (i.e. BluetoothLeService) service calling back into your app with listeners that now null/nil will cause hangs and thus a SIGABRT, see #2

SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • Im clearing everything and cleaning everything but it still randomly crashes everything worked as expected the ble device communicates with my app also show me the requested values its very strange looking for 3 weeks to this issue tried allot of things – Stefan van de Laarschot Apr 18 '16 at 13:23
  • I would imagine it is a bad reference, an object that is being GC on the Mono and/or Davik/ART, a peer object that is nil, something that is hanging the app, out of memory issue, **but without seeing some code I am just guessing**... As a side note: Have you tried using `GC.Collect()` at the end of your OnDestroy and setting up your Activity's OnLowMemory event, and add logging everywhere ;-) – SushiHangover Apr 18 '16 at 13:33
  • OnLowMemory is not getting fired – Stefan van de Laarschot Apr 18 '16 at 13:34
  • monodroid-glue.c:1144: gc_cleanup_after_java_collection: assertion "!sccs [i]->is_alive" failed 04-18 15:37:04.668 I/art (21664): Explicit concurrent mark sweep GC freed 29516(1647KB) AllocSpace objects, 17(4MB) LOS objects, 40% free, 17MB/29MB, paused 704us total 47.771ms at main thread CareAboutPauseTimes 1 04-18 15:37:04.668 F/libc (21664): monodroid-glue.c:1144: gc_cleanup_after_java_collection: assertion "!sccs [i]->is_alive" failed 04-18 15:37:04.668 F/libc (21664): Fatal signal 6 (SIGABRT), code -6 – Stefan van de Laarschot Apr 18 '16 at 13:38
  • 1
    BluetoothLeService im using – Stefan van de Laarschot Apr 18 '16 at 13:41
  • @StefanvandeLaarschot Take a look at https://bugzilla.xamarin.com/show_bug.cgi?id=33767 – SushiHangover Apr 19 '16 at 02:23
  • Its the same issue indeed but no solutions for it :( – Stefan van de Laarschot Apr 19 '16 at 07:25
  • Another possible cause: For me, I was getting a GL out of memory followed by this SIGABRT because I was doing canvas.drawLines () with a really thick (on the order of 75000 pixels) stroke width. – RhetoricalRuvim Feb 20 '18 at 07:58
  • A great answer to a broad question, thank you. – user1725145 Jul 15 '19 at 09:43
14

According to Wikipedia:

The SIGABRT signal is sent to a process to tell it to abort, i.e. to terminate. The signal is usually initiated by the process itself when it calls abort function of the C Standard Library, but it can be sent to the process from outside like any other signal

It usually indicates some kind of error in your code or one of the libraries that you call.

See also: When does a process get SIGABRT (signal 6)?

Community
  • 1
  • 1
Giorgi
  • 30,270
  • 13
  • 89
  • 125