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.
I have mmp 126.96.36.199 (master: 747d23d)
* check out and compile xamarin studio in your terminal
* Open md-addins/Xamarin.Designer.iOS/MTDesigner.sln
* Debug DesignerApp.Gtk
* Drag a scene or two in and then hit File -> Exit
You get a random crash every single time* typically from the finalizer. The actual crash changes a lot. Sometimes it's a native crash, sometimes it's a crash in managed code because our finalizer touches a managed object which tries to re-create the C# wrapper for an object with no IntPtr constructor.
I see no reason why this wouldn't affect XS too, but for the moment it does not seem reproducible there.
First sample managed crash, can be triggered by dragging a bunch of items from the toolbox to the surface and then exiting. That's the action which instantiates these objects.
2016-03-11 11:10:47.868 mono64[5245:50528]
System.Exception: Failed to marshal the Objective-C object 0x7fe718612b20 (type: Xamarin_Designer_Mac_DesignerDragOperationMac_MacDragImage_LayerScaleTransitionDelegate). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Xamarin.Designer.Mac.DesignerDragOperationMac+MacDragImage+LayerScaleTransitionDelegate' does not have a constructor that takes one IntPtr argument).
at ObjCRuntime.Runtime.MissingCtor (IntPtr ptr, IntPtr klass, System.Type type, MissingCtorResolution resolution) [0x0006e] in <filename unknown>:0
at ObjCRuntime.Runtime.ConstructNSObject[T] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x0002c] in <filename unknown>:0
at ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution) [0x00015] in <filename unknown>:0
at ObjCRuntime.Runtime.GetNSObject (IntPtr ptr, MissingCtorResolution missingCtorResolution, Boolean evenInFinalizerQueue) [0x00034] in <filename unknown>:0
at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject (System.Type type, IntPtr selector, IntPtr obj, System.IntPtr& mthis) [0x00068] in <filename unknown>:0
at ObjCRuntime.Runtime.GetMethodAndObjectForSelector (IntPtr klass, IntPtr sel, IntPtr obj, System.IntPtr& mthis) [0x0000c] in <filename unknown>:0
at ObjCRuntime.Runtime.get_method_and_object_for_selector (IntPtr cls, IntPtr sel, IntPtr obj, System.IntPtr& mthis) [0x00001] in <filename unknown>:0
at (wrapper native-to-managed) ObjCRuntime.Runtime:get_method_and_object_for_selector (intptr,intptr,intptr,intptr&)
at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend_IntPtr (intptr,intptr,intptr)
at CoreAnimation.CALayerDelegate.Dispose (Boolean disposing) [0x00026] in <filename unknown>:0
at Foundation.NSObject.Finalize () [0x00001] in <filename unknown>:0
Two native crashes: https://gist.github.com/alanmcgovern/ce7f7eb0e3b0b7115748
Rolf suggested this in slack:
Rolf Kvinge @alan: I assume the layer is called `LayerScaleTransition` - can you try overriding its Dispose method, and set Delegate to null and see if that fixes it?
However my concern is that since these objects are being cleaned up by the finalizer then overriding Dispose and trying to null out the Delegate will cause the same lookup problem and same managed exception as in comment 1. We could manually dispose these objects when we're done in order avoid the problem though.