Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
To reproduce, add the following lines to a Xamarin.Mac app:
var ip = NSIndexPath.FromIndex (1);
Also, setting a breakpoint on Console.WriteLine, hovering over the ip var and expanding to view properties will crash the app.
crash log output: https://gist.github.com/colbylwilliams/ba620fa9e51224dee5893dd0dfe23564
version info: https://gist.github.com/colbylwilliams/a3d078c3f99eb46c4ea780fde8638bc8
Created attachment 16199 [details]
Adding a repro project for simplicity. The relevant code (two lines from original comment) is in AppDelegate.cs
The same code in objective-c:
NSIndexPath * i = [[NSIndexPath alloc] initWithIndex:1];
NSLog (@"%ld", i.item);
gives the same exception:
2016-06-06 09:47:39.724 ButtonTest[39242:16082641] Invalid index path for use with NSCollectionView. Index paths passed to collection view must contain exactly two indices specifying the section and row. Please use the category on NSIndexPath in NSCollectionView.h if possible.
however, it is not fatal there.
var ip = NSIndexPath.FromItemSection (0, 0);
and it "works".
I'm going to keep the bug around, since we should try to either catch this assertion or at least make the properties not auto expand in the debugger (to prevent crashes).
So it turns out that objective-c code throws a nasty gram in mac in Xcode but not iOS. Apple has different behavior. :(
Rolf is introducing "--marshal-objectivec-exceptions=throwmanaged" which will be the default in 64-bit debug which promotes this to a managed exception, which prevents the watch/local window from killing us by expanding an index path.
I don't think we really can't remove the item property from the watch window / index. It is a rather common one.
So for reasons of backwards compatibility we can't make --marshal-objectivec-exceptions=throwmanaged default, but @rajneesh if you add --marshal-objectivec-exceptions=throwmanaged as an additional mmp argument with a modern build you should see that it is fixed.