Bug 16504 - Crash in (wrapper managed-to-native) for NSOutlineViewDataSource
Summary: Crash in (wrapper managed-to-native) for NSOutlineViewDataSource
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 1.6.19
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Aaron Bockover [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2013-11-28 21:01 UTC by More
Modified: 2015-01-16 20:37 UTC (History)
3 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description More 2013-11-28 21:01:39 UTC
I am using NSOutlineView to display a folder tree of remote CMIS server, and I implements CmisTreeDataSource derived from NSOutlineViewDataSource. In the CmisTreeDataSource, there is a member variable that uses some advanced .net technologies such as System.ComponentModel.BackgroundWorker and System.ComponentModel.INotifyPropertyChanged.

During the test, I find it crashed very frequently as blow:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) MonoMac.ObjCRuntime.Messaging.intptr_objc_msgSend (intptr,intptr) <IL 0x00026, 0xffffffff>
  at MonoMac.ObjCRuntime.Runtime.GetNSObject (intptr) [0x00070] in /Users/builder/data/lanes/xamcore-lion-mono-3.2-stable/14f46184/source/xamcore/src/preprocessed-build/32-bit/monomac/src/ObjCRuntime/Runtime.cs:177
  at MonoMac.ObjCRuntime.NSObjectMarshaler`1.MarshalNativeToManaged (intptr) [0x00002] in /Users/builder/data/lanes/xamcore-lion-mono-3.2-stable/14f46184/source/xamcore/src/preprocessed-build/32-bit/monomac/src/ObjCRuntime/NSObjectMarshaler.cs:33
  at (wrapper native-to-managed) object.[CmisSync.CmisTree.CmisTreeDataSource.MonoMac.Foundation.NSObject GetObjectValue(MonoMac.AppKit.NSOutlineView, MonoMac.AppKit.NSTableColumn, MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.AppKit.NSOutlineView,MonoMac.AppKit.NSTableColumn,MonoMac.Foundation.NSObject) <IL 0x0014f, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) MonoMac.AppKit.NSApplication.NSApplicationMain (int,string[]) <IL 0x0009d, 0xffffffff>
  at MonoMac.AppKit.NSApplication.Main (string[]) [0x00041] in /Users/builder/data/lanes/xamcore-lion-mono-3.2-stable/14f46184/source/xamcore/src/preprocessed-build/32-bit/monomac/src/AppKit/NSApplication.cs:106
  at CmisSync.UI.Run () [0x00007] in /Users/more0401/Desktop/OpenDataSpace/gds2/DataSpaceSync.work/CmisSync/Mac/UI.cs:70
  at CmisSync.Program.Main (string[]) [0x001c9] in /Users/more0401/Desktop/OpenDataSpace/gds2/DataSpaceSync.work/CmisSync/Program.cs:126
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

I find MonoMac uses marshal technology to transit between native cocoa codes and managed .net codes, and I hesitate that manshal does not work well for the dynamic data structures (BackgroundWorker as backend thread, which will change the CmisTreeDataSource member variable). Is my point correct, or there are some other issues?

Now I have used some other technologies to avoid dynamic data structures, and it works well. Still I want to know what the possible root cause is, and I can take care it in later days.
Comment 1 Miguel de Icaza [MSFT] 2014-12-03 15:10:42 UTC
It is likely caused by background updates to your state.

But hard to pinpoint without a complete test case.

Also the logs do not show what actually happened, so it is hard to tell.
Comment 2 More 2014-12-14 21:23:18 UTC
It seems the latest Xamarin.Mac 1.10.0.18 (currently used by me) is much stabler, and this issue is fixed already.
And I think may be the same issue with my previously reported one: https://bugzilla.xamarin.com/show_bug.cgi?id=17365, which is also fixed in a later Xamarin.Mac version.

You can close this issue.