Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 703 forks source link

Crash on iOS: EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 #926

Open abosquet opened 4 years ago

abosquet commented 4 years ago

BUG / PROBLEM REPORT

SUMMARY

I get from Crashlytics a few crashes from multiple users with different iPhones/iOS versions (Crash-free statistics=70%) I am not able to reproduce it. I'm not sure but it may happen while terminating app and is not visible for the user.

VERSIONS

Xamarin.Forms 4.6.0.772 ZXing.Net.Mobile 3.0.0-beta5

PLATFORMS

HOW TO REPRODUCE

I wasn't able to reproduce it, however I received on Crashlytics call stack:

Crashed: tid_1907
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
Crashed: tid_1907
0  MyApp.iOS                 0x1022e8538 ZXing_Datamatrix_Internal_BitMatrixParser__ctor_ZXing_Common_BitMatrix + 38 (BitMatrixParser.cs:38)
1  MyApp.iOS                 0x1022eb300 ZXing_Datamatrix_Internal_Decoder_decode_ZXing_Common_BitMatrix + 62 (Decoder.cs:62)
2  MyApp.iOS                 0x1022eb300 ZXing_Datamatrix_Internal_Decoder_decode_ZXing_Common_BitMatrix + 62 (Decoder.cs:62)
3  MyApp.iOS                 0x1022ded04 ZXing_Datamatrix_DataMatrixReader_decode_ZXing_BinaryBitmap_System_Collections_Generic_IDictionary_2_ZXing_DecodeHintType_object + 68 (DataMatrixReader.cs:68)
4  MyApp.iOS                 0x102272294 ZXing_MultiFormatReader_decodeInternal_ZXing_BinaryBitmap + 210 (MultiFormatReader.cs:210)
5  MyApp.iOS                 0x102271484 ZXing_MultiFormatReader_decodeWithState_ZXing_BinaryBitmap + 90 (MultiFormatReader.cs:90)
6  MyApp.iOS                 0x10226e310 ZXing_BarcodeReaderGeneric_Decode_ZXing_LuminanceSource + 223 (BarcodeReaderGeneric.cs:223)
7  MyApp.iOS                 0x10235d554 ZXing_Mobile_ZXingScannerView__c__DisplayClass37_0__SetupCaptureSessionb__0_ZXing_LuminanceSource + 249 (ZXingScannerView.ios.cs:249)
8  MyApp.iOS                 0x10235d2a8 ZXing_Mobile_ZXingScannerView_OutputRecorder_DidOutputSampleBuffer_AVFoundation_AVCaptureOutput_CoreMedia_CMSampleBuffer_AVFoundation_AVCaptureConnection + 472 (ZXingScannerView.ios.cs:472)
9  MyApp.iOS                 0x1010591d0 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 4774844
10 MyApp.iOS                 0x1028cbe94 mono_jit_runtime_invoke + 3164 (mini-runtime.c:3164)
11 MyApp.iOS                 0x10298c5dc mono_runtime_invoke_checked + 3044 (object.c:3044)
12 MyApp.iOS                 0x10298fee0 mono_runtime_invoke + 3099 (object.c:3099)
13 MyApp.iOS                 0x100cad420 native_to_managed_trampoline_102(objc_object*, objc_selector*, _MonoMethod**, objc_object*, objc_object*, objc_object*, unsigned int) + 5429 (registrar.m:5429)
14 MyApp.iOS                 0x100cad4b4 -[ZXing_Mobile_ZXingScannerView_OutputRecorder captureOutput:didOutputSampleBuffer:fromConnection:] + 14596 (registrar.m:14596)
15 AVFoundation                   0x1b6fd022c -[AVCaptureVideoDataOutput _processSampleBuffer:] + 336
16 AVFoundation                   0x1b6fcff70 __47-[AVCaptureVideoDataOutput _updateRemoteQueue:]_block_invoke + 92
17 CoreMedia                      0x1b3548ca8 __FigRemoteOperationReceiverCreateMessageReceiver_block_invoke + 292
18 CoreMedia                      0x1b3569988 __rqReceiverSetSource_block_invoke + 232
19 libdispatch.dylib              0x1ac88dfd8 _dispatch_client_callout + 20
20 libdispatch.dylib              0x1ac890758 _dispatch_continuation_pop + 408
21 libdispatch.dylib              0x1ac8a0f18 _dispatch_source_invoke2 + 892
22 libdispatch.dylib              0x1ac8a08c4 _dispatch_source_invoke + 428
23 libdispatch.dylib              0x1ac894320 _dispatch_lane_serial_drain + 264
24 libdispatch.dylib              0x1ac894e7c _dispatch_lane_invoke + 368
25 libdispatch.dylib              0x1ac89df20 _dispatch_workloop_worker_thread + 580
26 libsystem_pthread.dylib        0x1ac8f36d0 _pthread_wqthread + 280
27 libsystem_pthread.dylib        0x1ac8f99e8 start_wqthread + 8
knocte commented 4 years ago

ZXing.Net.Mobile 3.0.0-beta5

Can you test with version v2.4.1 please?

abosquet commented 4 years ago

ZXing.Net.Mobile 3.0.0-beta5

Can you test with version v2.4.1 please?

It's not an option for us because we have to use ZXing.Net 0.16.5 as min version FYI as workaround in OnAppearing and OnDisappearing event I enable/disable IsScanning & IsAnalyzing properties and no crash report anymore. Tested with > 1000 users.

knocte commented 4 years ago

FYI as workaround in OnAppearing and OnDisappearing event I enable/disable IsScanning & IsAnalyzing properties and no crash report anymore. Tested with > 1000 users.

Thanks for the info!