Bug 7696 - Should handle Objective-C exceptions in NSKeyedUnarchiver
Summary: Should handle Objective-C exceptions in NSKeyedUnarchiver
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.0.x
Hardware: PC Mac OS
: --- enhancement
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
Depends on:
Reported: 2012-10-05 16:45 UTC by Eric Fikus
Modified: 2012-10-23 19:31 UTC (History)
2 users (show)

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

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:

Description Eric Fikus 2012-10-05 16:45:07 UTC
The NSKeyedUnarchiver methods

    – initForReadingWithData:
    + unarchiveObjectWithData:
    + unarchiveObjectWithFile:

can commonly throw Objective-C exceptions that we can't handle on the main thread (eg when the unarchiver encounters unexpected data).

These are cases where it's common to wrap in a @try/@catch in Objective-C.  Is this something MT can handle, per http://stackoverflow.com/a/10549490?
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-10-06 04:19:13 UTC
Technically I believe it's possible, but we haven't looked into the details yet (I have vague plans to look into this some day, but there is nothing definite yet).
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-10-23 19:31:22 UTC
This has been fixed by doing custom marshalling of the exceptions for this particular class (NSKeyedUnarchiver).

The next release with this fix will be 6.0.6

master: 8554b5837c2e798e506030d845a8fe83bce1dfb4
ios6: 4af4f3efb8115298822780ff9a2ff353f322a623.