I have a barcode scanning application built in Xamarin.Android using the Zebra EMDK. Under Xamarin 4.9.0.749, it crashes 100% reproducibly at or near a call to scanner.Read():
03-09 13:27:43.043 F/ (21460): * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d15-6/xamarin-android/external/mono/mono/metadata/threads.c:3016, condition `internal' not met 03-09 13:27:43.043 F/libc (21460): Fatal signal 6 (SIGABRT), code -6 in tid 21532 (Thread-1255)
This only happens when running in the debugger; release builds work fine. I see the same problem on various platforms including TC70X, TC75X and WT6000.
This is a regression; the same code worked fine (in both release and debug modes) with prior Xamarin versions.
I am using Microsoft Visual Studio Professional 2015, Version 14.0.25431.01 Update 3, with Xamarin.Android SDK 8.2.0.15.
The problem can be easily re-created using the Zebra sample application.
Steps to recreate:
1. Open solution.
2. Change build mode from "Release" to "Debug".
3. Clean solution.
4. Build solution.
5. Connect target device via USB cable. Ensure USB debugging is enabled and that your target device model appears next to the "Run" in the toolbar.
6. Launch application in debugger.
7. When UI appears, check "continuous" box, then press "Start" button.
8. Press and release scan trigger a few times. (Two is usually enough. Ten always is.)
Additional information:
The same crash happens regardless of the specific version of Symbol.XamarinEMDK I link against. I've tried it with the default that comes with the sample app (2.4.0.87) as well as the latest pre-release EMDK in a NuGet package (2.7.0.76), plus some 2.5.x and 2.6.x intermediate versions.
It also doesn't seem to matter what target framework I use. The sample app default (Android 4.4 KitKat) exhibits the problem, as does Android 8.1 Oreo.