Bug 15816 - Using camera detection crash the iphone, but only if it is a 5S device
Summary: Using camera detection crash the iphone, but only if it is a 5S device
Status: RESOLVED UPSTREAM
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.0.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-10-30 09:30 UTC by Luca
Modified: 2013-11-07 13:26 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
this is the crash report that I extracted from Flurry because it has been generated on a user device that download the app on the appstore (49.79 KB, application/octet-stream)
2013-10-30 09:30 UTC, Luca
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED UPSTREAM

Description Luca 2013-10-30 09:30:46 UTC
Created attachment 5276 [details]
this is the crash report that I extracted from Flurry because it has been generated on a user device that download the app on the appstore

My app is experiencing a crash when entering DidOutputSampleBuffer in AVCaptureVideoDataOutputSampleBufferDelegate.

The crash happens only for iphone 5S devices.

I dont't have an iPhone 5S to replicate the crash myself, but I've some crash reports on Flurry coming from user that have downloaded the app from the app store.
Comment 1 Sebastien Pouliot 2013-10-30 10:16:37 UTC
We have 5S to test this - but we'll need a test case (as close as your production code as possible) to duplicate it. You can mark the attachment as private (so it will be visible only to you and Xamarin's employees). Make sure to use the same build options (in case it's specific to some particular options).

Also please provide the software versions you used to build your applicaiton.

The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Comment 3 Luca 2013-10-30 10:51:58 UTC
xamarin studio version: 4.0.12 (build 3)
Comment 4 Luca 2013-10-30 11:06:38 UTC
a question...could I use xamarin test cloud (I requested invite some times ago) to test directly on 5S myself ?

I'm quite concerned about this crash because my app is on the app store and these days are starting some advertising campaign that should increase the number of users...

If there's anything I can do furhter, please tell me.
Comment 5 Sebastien Pouliot 2013-10-30 13:05:02 UTC
That's not a complete set of version information. Please see my instruction to get all of them. I'll have a look at your code this afternoon (or when I get the above information).

note: you'll need to email back the TestCloud team (from your invite) to find how many 5S devices are up and running at the moment.
Comment 6 Luca 2013-10-30 13:09:59 UTC
=== Xamarin Studio ===

Version 4.0.12 (build 3)
Installation UUID: df40a29e-85e5-4fbf-bca3-aa4946b42aad
Runtime:
	Mono 3.2.3 ((no/8d3b4b7)
	GTK 2.24.20
	GTK# (2.12.0.0)
	Package version: 302030000

=== Apple Developer Tools ===

Xcode 5.0 (3332.25)
Build 5A1413

=== Xamarin.iOS ===

Version: 7.0.1.4 (Business Edition)
Hash: 4cfca2f
Branch: 
Build date: 2013-20-09 23:14:32-0400

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.Android ===

Not Installed

=== Build Information ===

Release ID: 400120003
Git revision: 593d7acb1cb78ceeeb482d5133cf1fe514467e39
Build date: 2013-08-07 20:30:53+0000
Xamarin addins: 25a0858b281923e666b09259ad4746b774e0a873

=== Operating System ===

Mac OS X 10.8.5
Darwin MACLION.local 12.5.0 Darwin Kernel Version 12.5.0
    Mon Jul 29 16:33:49 PDT 2013
    root:xnu-2050.48.11~1/RELEASE_X86_64 x86_64
Comment 7 Luca 2013-10-30 13:26:02 UTC
I don't have an invite yet to testclous, I subscribed this summer for the beta, ma no invite for now.
Comment 8 Sebastien Pouliot 2013-10-30 20:47:26 UTC
There's nothing obviously wrong in the attached code. However a SIGSEGV (like shown in your crash report) could be a simple NullReferenceException. That could happen in quite a few places in case some of the API you use returns null (on the 5S).

I'll try to see if I can duplicate it calling Setup from an app - however we can't invest much time to (re)create issues. It would be better (and faster) if you could attach a self-contained test case (that I could build using the _exact_ same options you're using).

As for TestCould you might want to inquire with hello@xamarin.com as I don't know the exact status of the beta invites (and can't issue any invite myself).
Comment 10 Sebastien Pouliot 2013-10-30 21:14:07 UTC
Confirmed to be an Apple bug. You can get details here [1] and I strongly encourage you to file an issue (radar [2]) with Apple concerning this (so it get fixed in an upcoming maintenance release of iOS).

[1] http://stackoverflow.com/q/19018962/220643
[2] https://bugreport.apple.com/
Comment 11 Luca 2013-10-31 04:56:55 UTC
ok...thank you very much Sebastien for your help.

I'll file an issue with Apple.
Comment 12 Larry O'Brien 2013-11-07 13:26:25 UTC
It's not a complete solution, but `AVMetadataFaceObject`s can be successfully detected during a capture session. They have less information (no eye position, etc.) but if your use-case doesn't require that, they might be sufficient.

Something like:

//Add the metadata output channel
            metadataOutput = new AVCaptureMetadataOutput();
            var metadataDelegate = new MyMetadataOutputDelegate();
            metadataOutput.SetDelegate(metadataDelegate, DispatchQueue.MainQueue);
            session.AddOutput(metadataOutput);
            //Confusing! *After* adding to session, tell output what to recognize...
            metadataOutput.MetadataObjectTypes = new NSString[] {
                AVMetadataObject.TypeFace
            };

 public override void DidOutputMetadataObjects(AVCaptureMetadataOutput captureOutput, AVMetadataObject[] metadataObjects, AVCaptureConnection connection)
        {
            foreach(var m in metadataObjects)
            {
                if(m is AVMetadataFaceObject)
                {
                    MetadataFound(this, m as AVMetadataFaceObject);
                }
            }
        }