Our customer is experiencing random app crashes. Our app is developed in Xamarin.Forms running only in Android devices (that's why i post this here). We retrieved our customer's devices in order to get any further info from our app logs + logcat. Digging into those logs, we can see the real cause of the application quitting abruptly. For any reason, the process of our app dies because of a SIGABRT signal, as we can see here:
D/dalvikvm( 4460): GC_EXPLICIT freed 4069K, 31% free 21542K/31192K, paused 3ms+9ms, total 45ms I/dalvikvm( 4460): JNI ERROR (app bug): accessed deleted global reference 0x20701a0a E/dalvikvm( 4460): VM aborting F/libc ( 4460): Fatal signal 6 (SIGABRT) at 0x0000116c (code=-6), thread 8100 (com.company.app) I/DEBUG ( 251): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 251): Build fingerprint: 'Honeywell/helsinki/CT50LFN-CS13S:4.4.4/KTU84P/59.02.03.0033:user/release-keys' I/DEBUG ( 251): Revision: '0' I/DEBUG ( 251): pid: 4460, tid: 8100, name: com.company.app >>> com.company.app <<< I/DEBUG ( 251): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Doing some research i've found several links where people had similar problems:
Following the guidance made by @JonathanPryor on those 2 links, i enabled GREF logging on the device using:
adb shell setprop debug.mono.log gref-
while testing our app, but i've encountered with 2 major drawbacks: The app runs reeealy slow, and i think that because of this i can't reproduce this SIGABRT. And finally, the Global Reference Messages displayed into LogCat doesn't display the stacktrace where the references are made, eg
I/monodroid-gref(27342): +g+ grefc 252 gwrefc 0 obj-handle 0xe4300021/L -> new-handle 0x1d3008c6/G from thread '(null)'(1)
and given that scenario, i can't determine if a reference is being disposed on my codebase explicitly or anything else.
Another pattern found in the logs received, is that before those SIGABRT crashes there are GC logs present, sometimes strictly before the "Fatal signal 6" message (such as the one shown here), and sometimes a bit more early. Those GC logs vary from GC_EXPLICIT to GC_CONCURRENT.
At this time me and my team can't find any direct solution applicable to our code. Is there any further help avialable about this issue? do we have to wait for a Xamarin update in order to get this issue resolved? Why does the GREF messages doesn't display the adequate stacktrace?