Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXC_BAD_ACCESS on VideoFeed.swift line 104: session.addInput(videoDeviceInput) #89

Closed
waltersanford opened this issue Oct 14, 2019 · 16 comments
Assignees

Comments

@waltersanford
Copy link

When trying to scan a credit card after using the camera, the video preview window appears empty and we get Thread 9: EXC_BAD_ACCESS (code=2, address=0x16db6fff8). The line of code that is failing is VideoFeed.swift, line 104: session.addInput(videoDeviceInput).

I've reproduced the error in CardScan - Example by adding a button that opens a standard UIImagePickerController. If you open the camera using the UIImagePickerController 3+ times and then tap the Scan Card button, the error will happen.

@kingst
Copy link
Collaborator

kingst commented Oct 14, 2019

Thanks for the bug report, Walter. We're on it.

@jaimejiyepark can you take a look?

@jaimejiyepark
Copy link
Collaborator

taking a peek now! let me see if i can reproduce this.

@waltersanford
Copy link
Author

PR for fix is here: #90

@waltersanford
Copy link
Author

Here is the example app with the changes needed to take photos:
Example.zip

@jaimejiyepark
Copy link
Collaborator

Thanks Walter! Taking a look now.

@jaimejiyepark
Copy link
Collaborator

Hey @waltersanford ,
I was not able to reproduce your error with your example and with my own implementation with your description or the error.

@jaimejiyepark
Copy link
Collaborator

Is there another way to reproduce the error?

@waltersanford
Copy link
Author

Interesting, I wonder if its device specific. What device are you testing on? I'll try it on several here.

@jaimejiyepark
Copy link
Collaborator

jaimejiyepark commented Oct 16, 2019

I am testing on my iPhone 8 Plus + iOS13. What about you?

@waltersanford
Copy link
Author

waltersanford commented Oct 16, 2019

Here is what I have so far:
iPhone Xs Max (13.1.2) - EXC_BAD_ACCESS
iPhone 6s Plus (12.4.1) - not happening
iPad Air 2 (13.1.2) - not happening

@waltersanford
Copy link
Author

I've updated that original iPhone Xs Max to 13.1.3 and I still get the error. I'll track down another similar device and see if I can reproduce it there.

@jaimejiyepark
Copy link
Collaborator

I will also try to run it on an iPhone Xs Max. Will get back to you shortly.

@waltersanford
Copy link
Author

I just tried it on an iPhone Xs (13.1.2). I couldn't reproduce the crash in the same way but I was able to cause it to crash using a different set of steps: In my version of the Example app I opened the Scan window 3 times (tapping the Scan Card button, then the Back button) and then tapped the Take Photo button.

@waltersanford
Copy link
Author

Good news. Applying the fix in my PR fixes the second crash too. I'm calling it a second crash because it's also an EXC_BAD_ACCESS with code=2 but it doesn't have the same stack trace.

@waltersanford
Copy link
Author

So far it's only reproducible on the iPhone Xs and Xs Max. It doesn't happen on the iPhone 8, iPhone 6s Plus or the iPad Air 2.

@jaimejiyepark
Copy link
Collaborator

Hey @waltersanford.
Sorry for taking so long getting back to you. After being able to reproduce your error and testing it ourselves, it looks like your fix works! Thank you and we will be closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants