blinkid-ios icon indicating copy to clipboard operation
blinkid-ios copied to clipboard

Crash: Fatal Exception: NSGenericException *** -[AVCaptureSession stopRunning] stopRunning may not be called between calls to beginConfiguration and commitConfiguration

Open yakobz opened this issue 5 years ago • 12 comments

  • Xcode version: 10.3
  • BlinkID SDK version: 4.9.1
  • What are you trying to scan? I don't know, we can't reproduce this issue on test environment. We allow users to scan driver license, ID and passport for UK.

This crash reproduces only on prod for real users, we can't reproduce this crash on test environment

I can attach crash report, but I don't have dSyms, so it unsymbolicated.

yakobz avatar Oct 01 '19 10:10 yakobz

Hi @yakobz,

Please provide us as much information as possible, together with the crash report. It would also be helpful for us to see how did you implement the scanning, so if you could share the code snippet it would be great.

You can also contact us directly at [email protected] (if you don't want to share the code publicly).

Regards

culoi avatar Oct 01 '19 10:10 culoi

Same thing for BlinkdID SDK 4.10. But crash happens only in iOS 10 for me

Vitalii-Gozhenko avatar Oct 21 '19 08:10 Vitalii-Gozhenko

I am also facing similar issue in Microblink 4.8.0... It is sometimes crashing after scanning. I had even called [weakSelf.recognizerRunnerViewController overlayViewControllerWillCloseCamera:weakSelf] before dismissing the View controller but no luck... it is still sometimes crashing.

prasoonpuri12 avatar Nov 03 '19 09:11 prasoonpuri12

Hi @VitaliyGozhenko @prasoonpuri12

Can you please let us know how can we reproduce this crash?

Which recognizers and settings are you using?

Best

culoi avatar Nov 04 '19 12:11 culoi

Hi @yakobz, @VitaliyGozhenko, @prasoonpuri12,

Can we ask you to check if this issue still happens on v5.3?

Thank you, Jurica.

Cerovec avatar Mar 20 '20 11:03 Cerovec

Hi @yakobz, @VitaliyGozhenko, @prasoonpuri12,

Do you have any news about this issue?

We appreciate your help! Jurica.

Cerovec avatar Apr 06 '20 15:04 Cerovec

I see this issue quite a lot on our app, we are using version 4.11.0, not all of us have a license for v5 and up, so this is what we can try right now: Class using Microblink https://gist.github.com/yaakovgamliel/6174c787e9afe2afe07229b51fbe83af Stacktrace:

CrashReporter Key:  
Hardware Model:     iPad4,5
OS Version:         iOS 12.4.2



NSGenericException: *** -[AVCaptureSession stopRunning] stopRunning may not be called between calls to beginConfiguration and commitConfiguration

0 CoreFoundation          ___exceptionPreprocess
1 libobjc.A.dylib         _objc_exception_throw
2 AVFoundation            -[AVCaptureSession stopRunning]
3 Microblink              0xad490 (-0x101354000 + 4315944080)
4 libdispatch.dylib       __dispatch_client_callout
5 libdispatch.dylib       __dispatch_lane_serial_drain$VARIANT$mp
6 libdispatch.dylib       __dispatch_lane_invoke$VARIANT$mp
7 libdispatch.dylib       __dispatch_workloop_worker_thread
8 libsystem_pthread.dylib __pthread_wqthread
9 libsystem_pthread.dylib _start_wqthread

yaakovgamliel avatar Apr 06 '20 20:04 yaakovgamliel

Hi @yaakovgamliel

It should not be a problem to get a valid license for v5, especially if you'll continue using the same features. I can help you out if you contact support at microblink.com.

Regarding the crash. It's not 100% clear how it would happen.

But, the issue is that [AVCaptureSession stopRunning] is obviously being called between beginConfiguration and commitConfiguration. stopRunning is called every time you call pauseCamera, while beginConfiguration and commitConfiguration are called everytime you call resumeCamera.

My best guess is that we have a race condition which causes the first one to be called while the other is in progress.

At first glance it seems to me like that the calls to pauseCamera and resumeCamera are synchronized on the main queue. Do you think the same? Are there any other calls to pauseCamera and resumeCamera?

Thanks, Jurica.

Cerovec avatar Apr 07 '20 19:04 Cerovec

Hi @yaakovgamliel,

Do you have any news about this? Can we help you to obtain new license keys?

Thanks, Jurica.

Cerovec avatar Apr 17 '20 05:04 Cerovec

We can’t do an upgrade right now since it requires migration work, v5 has quite some breaking changes we will probably work on it next week since we continue to see this crash in production, the migration is not an easy task specially since most of the docs still have examples from previous versions.

yaakovgamliel avatar Apr 17 '20 06:04 yaakovgamliel

Hi @yaakovgamliel,

Thanks for the update. Can we jump to a short call before you start the upgrade? I’d want to understand which challenges you face. This will help us to improve the docs and examples for all other developers who face the same challenge.

Thanks, Jurica.

Cerovec avatar Apr 19 '20 15:04 Cerovec

Sure, I may do some work this week I’ll post the code we have for it here.

yaakovgamliel avatar Apr 19 '20 15:04 yaakovgamliel

Hello! Are there any updates here? Do we know if newer versions mitigate this crash?

dingwilson avatar Aug 22 '22 19:08 dingwilson

Hi,

Yes we had not experienced this issue new newer version of Blink ID. You can close the ticket. Thanks.

Regards, Prasoon Puri

On Mon, 22 Aug 2022 at 11:22 PM, Wilson Ding @.***> wrote:

Hello! Are there any updates here? Do we know if newer versions mitigate this crash?

— Reply to this email directly, view it on GitHub https://github.com/BlinkID/blinkid-ios/issues/266#issuecomment-1222812130, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZKS4ASUHPTDGRODZADBOLV2PHOZANCNFSM4I4HSCHQ . You are receiving this because you were mentioned.Message ID: @.***>

prasoonpuri12 avatar Aug 23 '22 13:08 prasoonpuri12

Hi @dingwilson and @prasoonpuri12

Yes, this was fixed in later versions of the SDK. I suggest trying out the current latest version, 5.18.0, on your side to confirm if the issue was resolved.

Let me know if you have any additional questions.

mparadina avatar Aug 23 '22 13:08 mparadina

Hi @dingwilson and @prasoonpuri12

Is it alright to close the issue? If anything comes up related to the topic, you can always reopen the issue or create a new one.

mparadina avatar Aug 26 '22 08:08 mparadina

Yes, it is working. Please close it

On Fri, 26 Aug 2022 at 12:53 PM, mparadina @.***> wrote:

Hi @dingwilson https://github.com/dingwilson and @prasoonpuri12 https://github.com/prasoonpuri12

Is it alright to close the issue? If anything comes up related to the topic, you can always reopen the issue or create a new one.

— Reply to this email directly, view it on GitHub https://github.com/BlinkID/blinkid-ios/issues/266#issuecomment-1228238513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZKS4CYXTVW4I4KV6FOI6DV3CAY3ANCNFSM4I4HSCHQ . You are receiving this because you were mentioned.Message ID: @.***>

prasoonpuri12 avatar Aug 26 '22 08:08 prasoonpuri12

@prasoonpuri12 thank you for the feedback!

Closing the issue.

mparadina avatar Aug 26 '22 09:08 mparadina