Bug 31074 - [Gtk#] Attempting to resurrect dead objects inside a finalizer
Summary: [Gtk#] Attempting to resurrect dead objects inside a finalizer
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2015-06-12 12:49 UTC by Alan McGovern
Modified: 2015-06-17 02:14 UTC (History)
2 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 Alan McGovern 2015-06-12 12:49:27 UTC
I saw this on wrench at the end of a test run. It looks like there's a mis-implemented finalizer and we're touching objects which have already been finalized, thus causing us to try to re-wrap them.

  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
GLib.MissingIntPtrCtorException: GLib.Object subclass MonoDevelop.SourceEditor.SourceEditorWidget+DecoratedScrolledWindow must provide a protected or public IntPtr ctor to support wrapping of native object handles.
  at GLib.ObjectManager.CreateObject (IntPtr raw) [0x0006d] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/ObjectManager.cs:47 
  at GLib.Object.GetObject (IntPtr o, Boolean owned_ref) [0x0009d] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/Object.cs:134 
  at GLib.Value.op_Explicit (Value val) [0x00009] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/Value.cs:307 
  at GLib.Value.get_Val () [0x00304] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/Value.cs:380 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x0004c] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/SignalClosure.cs:141 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/ExceptionManager.cs:line 58
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/SignalClosure.cs:line 173
   at Gtk.Object.gtk_object_destroy(IntPtr )
   at Gtk.Object.Destroy() in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/gtk/generated/Object.custom:line 131
   at Gtk.Widget.Destroy() in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/gtk/generated/Widget.custom:line 34
   at MonoDevelop.SourceEditor.SourceEditorWidget.Dispose() in /Users/builder/data/lanes/1507/9ccaa6d6/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs:line 475
   at MonoDevelop.SourceEditor.SourceEditorView.Dispose() in /Users/builder/data/lanes/1507/9ccaa6d6/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:line 971
   at MonoDevelop.Ide.Editor.TextEditor.Dispose(Boolean disposing) in /Users/builder/data/lanes/1507/9ccaa6d6/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs:line 845
   at MonoDevelop.Components.Control.Finalize() in /Users/builder/data/lanes/1507/9ccaa6d6/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs:line 53
Comment 1 xamarin-release-manager 2015-06-17 02:13:31 UTC
Fixed in version 6.0.0.256 (roslyn)
Comment 2 Mike Krüger 2015-06-17 02:14:39 UTC
Which test was that ?

This shouldn't be possible unless something is wrong with the destroy chain (Maybe dispose was called on the vbox, releasing resources and not Destroy) - or a race condition because that's not thread safe.

Anyways I tried a patch.