My latest release is crashing at a rate of about 99 per 1000 devices - significantly higher than the release before it. New crashes come in 2 flavors in libmonosgen:
Cluster 1: libmonosgen-2.0.so
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
libmonosgen-2.0.so
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.dailybits.foodjournal <<<
backtrace:
#00 pc 0000000000192304 /data/app/com.dailybits.foodjournal-KapbLS3Zx20G2S79yI3CTw==/lib/arm/libmonosgen-2.0.so
Cluster 2: libmonosgen-2.0.so (mono_class_get_flags)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
mono_class_get_flags
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.dailybits.foodjournal <<<
backtrace:
#00 pc 000000000014f310 /data/app/com.dailybits.foodjournal-rwLqwfyotHI-Ulk481Wk8g==/lib/arm64/libmonosgen-2.0.so (mono_class_get_flags)
Pre-release report is looking all green, and App Center has none of these crashes, they only show up in Google Play.
Questions:
Does anyone know what pid:0 and tid:0 mean? Does this mean these crashes are occurring before the application code is loaded, or is that unrelated?
If this isn't at app startup, can I somehow find out after how long the crash occurs? Or even better, can I correlate the crashes to app generated session logs?
Is there a way to configure Play, or the App to collect better traces?
Configuration details below
(both build options appear to result in the same problem)
Version info
Microsoft Visual Studio Professional 2019
Version 16.4.2
VisualStudio.16.Release/16.4.2+29613.14
Microsoft .NET Framework
Version 4.8.03752
Xamarin 16.4.000.307 (d16-4@e031886)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android SDK 10.1.1.0 (d16-4/f2c9364)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: bef1e63
Java.Interop: xamarin/java.interop/d16-4@c4e569f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.28.0@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b
Edit 2/17/2020
Some of my investigation to date:
- Looks like libmonosgen contains the Xamarin garbage collector.
- SEGV_ACCERR is an access denied on a platform object (IE object already disposed). A good way to get these apparently is to have static objects accessed from multiple threads. I'm thinking this may mean one of the threads disposes the underlaying Java object, without telling the Mono runtime.
- Third party libraries, as well as new Java objects (IE changes to UI controls I'm using) are suspects.
I've decided to go with a fine-toothed comb through all the changes, revert all the package updates, and re-do them one-by-one, until a release starts crashing. If I'm unlucky, it's going to take a few weeks, but it should work to find out what causes the crash. It should also allow me to ship my new features to 100% without creating a spike in crashes for all users. Fingers crossed :)