Bug 28885 - Simple App that runs on version 1.12.0 SegSevs on version 2.0.0.197
Summary: Simple App that runs on version 1.12.0 SegSevs on version 2.0.0.197
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 2.0.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 2.0.x
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-04-08 10:04 UTC by Kevin Mullins
Modified: 2015-04-08 10:42 UTC (History)
1 user (show)

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


Attachments
Sample app that is crashing in new version (73.26 KB, application/zip)
2015-04-08 10:04 UTC, Kevin Mullins
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 ANSWERED

Description Kevin Mullins 2015-04-08 10:04:44 UTC
Created attachment 10672 [details]
Sample app that is crashing in new version

The attached sample Xamarin.Mac application runs correctly on version 1.12 but crashes on launch with version 2.0.0.197 with a SegSev error.
Comment 1 Chris Hamons 2015-04-08 10:19:33 UTC
The stack trace in question.

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (intptr,intptr,intptr) <IL 0x00011, 0xffffffff>
  at AppKit.NSOutlineView.set_WeakDataSource (Foundation.NSObject) [0x00060] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/build/mac/full/AppKit/NSOutlineView.g.cs:780
  at AppKit.NSOutlineView.set_DataSource (AppKit.INSOutlineViewDataSource) [0x00031] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/build/mac/full/AppKit/NSOutlineView.g.cs:618
  at Rotation.OutlineViewController.Initialize () [0x00008] in /Users/donblas/Downloads/Rotation/Rotation/SourceListOutline/OutlineViewController.cs:62
  at Rotation.OutlineViewController..ctor (intptr) [0x00009] in /Users/donblas/Downloads/Rotation/Rotation/SourceListOutline/OutlineViewController.cs:35
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___intptr (object,intptr,intptr,intptr) <IL 0x00064, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <IL 0x0001c, 0xffffffff>
  at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) [0x00002] in /Users/donblas/Programming/maccore/maccore-current/maccore/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:535
  at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x000a5] in /Users/donblas/Programming/maccore/maccore-current/maccore/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:526
  at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00000] in /Users/donblas/Programming/maccore/maccore-current/maccore/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:554
  at System.Reflection.ConstructorInfo.Invoke (object[]) [0x00000] in /Users/donblas/Programming/maccore/maccore-current/maccore/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
  at ObjCRuntime.Runtime.ConstructNSObject<T> (intptr,System.Type,ObjCRuntime.Runtime/MissingCtorResolution) [0x00055] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/ObjCRuntime/Runtime.cs:685
  at ObjCRuntime.Runtime.ConstructNSObject (intptr,intptr,ObjCRuntime.Runtime/MissingCtorResolution) [0x00018] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/ObjCRuntime/Runtime.cs:666
  at ObjCRuntime.Runtime.GetNSObject (intptr,ObjCRuntime.Runtime/MissingCtorResolution,bool) [0x00035] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/ObjCRuntime/Runtime.cs:764
  at ObjCRuntime.Runtime.TryGetOrConstructNSObjectWrapped (intptr) [0x00004] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/ObjCRuntime/Runtime.cs:355
  at ObjCRuntime.Runtime.try_get_or_construct_nsobject (intptr) [0x00002] in /Users/donblas/Programming/maccore/maccore-current/maccore/runtime/Delegates.generated.cs:190
  at (wrapper native-to-managed) ObjCRuntime.Runtime.try_get_or_construct_nsobject (intptr) <IL 0x0002b, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (intptr,intptr) <IL 0x00012, 0xffffffff>
  at AppKit.NSWindowController.get_Window () [0x0003a] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/build/mac/full/AppKit/NSWindowController.g.cs:607
  at Rotation.MainWindowController.get_Window () [0x00002] in /Users/donblas/Downloads/Rotation/Rotation/MainWindowController.cs:29
  at Rotation.AppDelegate.DidFinishLaunching (Foundation.NSNotification) [0x00012] in /Users/donblas/Downloads/Rotation/Rotation/AppDelegate.cs:19
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00062, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) AppKit.NSApplication.NSApplicationMain (int,string[]) <IL 0x00093, 0xffffffff>
  at AppKit.NSApplication.Main (string[]) [0x00041] in /Users/donblas/Programming/maccore/maccore-current/maccore/src/AppKit/NSApplication.cs:94
  at Rotation.MainClass.Main (string[]) [0x00007] in /Users/donblas/Downloads/Rotation/Rotation/Main.cs:12
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00060, 0xffffffff>
Comment 2 Chris Hamons 2015-04-08 10:24:33 UTC
So this appears to have broken due to the changes I made to make delegates handle C# events / subclassing more solid. We are doing more work now, and it appears some of that work is calling into super and blowing up.

However, the code in question is a bit sketchy. You are setting up your Delegate / Data source inside the Initialize method. Normally, you setup things like this inside AwakeFromNib.

		public override void AwakeFromNib ()
		{
			// Initialize this instance
			this.DataSource = new OutlineDataSource (this);
			this.Delegate = new OutlineViewDelegate (this);
		}

This code ^ works.

I'm going to keep this open for a bit while I research if this is an issue we can/should fix.
Comment 3 Chris Hamons 2015-04-08 10:42:12 UTC
Having that code in Initialize is actually more wrong, since if we have to surface a view controller from an unmanaged pointed (via the IntPtr ctor) we'll blap your DataSource/Delegate.

Unless proven otherwise, I'm fine saying you should just fix that code to be in AwakeFromNib or at some other point later in the lifecycle.
Comment 4 Chris Hamons 2015-04-08 10:42:25 UTC
Thanks for the report though!