[Gtk-sharp-list] Random NullReferenceExceptions in GLib
David Makovský
yakeen@sannyas-on.net
Tue, 10 May 2005 14:41:42 +0200
--=-vBmBOUuYdt8acGg8Hw0q
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Hi,
That seems to be similar problem like
http://bugzilla.ximian.com/show_bug.cgi?id=53181
I tested it today with mono 1.1.7 and svn gtk-sharp and safely for eight
closing I', getting this
Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
in <0x00000> <unknown method>
in (wrapper managed-to-native) Gtk.Widget:gtk_widget_destroy (intptr)
in <0x00017> Gtk.Widget:Destroy ()
in <0x00161> TestDialogs.GuiAlertGlade:.ctor (System.String s,
System.String m)
in <0x0002a> TestDialogs.TestWindow:GladeClicked (System.Object obj,
System.EventArgs args)
in (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)
in <0x00096> GLib.Signal:voidObjectCallback (IntPtr handle, IntPtr gch)
in (wrapper native-to-managed) GLib.Signal:voidObjectCallback
(intptr,intptr)
in <0x00000> <unknown method>
in (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00007> Gtk.Application:Run ()
in <0x001c4> TestDialogs.TestWindow:.ctor ()
in <0x00020> TestDialogs.Run:Main (System.String[] args)
David Makovsky
Mike Kestner pĂše v Po 09. 05. 2005 v 16:02 -0500:
> On Fri, 2005-05-06 at 18:39 -0700, Todd Berman wrote:
>
> > > Unhandled Exception: System.NullReferenceException: Object reference not
> > > set to an instance of an object
> > > in (unmanaged) 0x8ac9250
> > > in <0x00004> (wrapper managed-to-native) GLib.Object:g_object_unref
> > > (intptr)
> > > in [0x00099] (at /home/brady/sources/gtk-sharp/glib/Object.cs:65)
> > > GLib.Object:PerformQueuedUnrefs ()
>
> > I am actually starting to see this too, not sure what is going on at
> > all, and it is also exposing itself under win32, so it is not linux
> > specific. I am wondering what has recently changed.
>
> Looks like an attempt to unref an object that's already been finalized.
> Generally, I start tracking these down by putting a C.WL in
> PerformQueuedUnrefs to identify the type of object being released. Put
> the C.WL before the g_object_unref call too so you know the type of the
> object being "disposed".
>
> I'm considering putting a try/catch around that to throw a useful
> exception to at least identify the type being disposed when all hell
> breaks loose.
--=-vBmBOUuYdt8acGg8Hw0q
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.6.2">
</HEAD>
<BODY>
Hi,<BR>
<BR>
That seems to be similar problem like <A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=53181">http://bugzilla.ximian.com/show_bug.cgi?id=53181</A><BR>
<BR>
I tested it today with mono 1.1.7 and svn gtk-sharp and safely for eight closing I', getting this<BR>
<BR>
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object<BR>
in <0x00000> <unknown method><BR>
in (wrapper managed-to-native) Gtk.Widget:gtk_widget_destroy (intptr)<BR>
in <0x00017> Gtk.Widget:Destroy ()<BR>
in <0x00161> TestDialogs.GuiAlertGlade:.ctor (System.String s, System.String m)<BR>
in <0x0002a> TestDialogs.TestWindow:GladeClicked (System.Object obj, System.EventArgs args)<BR>
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)<BR>
in <0x00096> GLib.Signal:voidObjectCallback (IntPtr handle, IntPtr gch)<BR>
in (wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr)<BR>
in <0x00000> <unknown method><BR>
in (wrapper managed-to-native) Gtk.Application:gtk_main ()<BR>
in <0x00007> Gtk.Application:Run ()<BR>
in <0x001c4> TestDialogs.TestWindow:.ctor ()<BR>
in <0x00020> TestDialogs.Run:Main (System.String[] args)<BR>
<BR>
David Makovsky<BR>
<BR>
Mike Kestner píše v Po 09. 05. 2005 v 16:02 -0500:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Fri, 2005-05-06 at 18:39 -0700, Todd Berman wrote:</FONT>
<FONT COLOR="#000000">> > Unhandled Exception: System.NullReferenceException: Object reference not</FONT>
<FONT COLOR="#000000">> > set to an instance of an object</FONT>
<FONT COLOR="#000000">> > in (unmanaged) 0x8ac9250</FONT>
<FONT COLOR="#000000">> > in <0x00004> (wrapper managed-to-native) GLib.Object:g_object_unref</FONT>
<FONT COLOR="#000000">> > (intptr)</FONT>
<FONT COLOR="#000000">> > in [0x00099] (at /home/brady/sources/gtk-sharp/glib/Object.cs:65)</FONT>
<FONT COLOR="#000000">> > GLib.Object:PerformQueuedUnrefs ()</FONT>
<FONT COLOR="#000000">> I am actually starting to see this too, not sure what is going on at</FONT>
<FONT COLOR="#000000">> all, and it is also exposing itself under win32, so it is not linux</FONT>
<FONT COLOR="#000000">> specific. I am wondering what has recently changed.</FONT>
<FONT COLOR="#000000">Looks like an attempt to unref an object that's already been finalized.</FONT>
<FONT COLOR="#000000">Generally, I start tracking these down by putting a C.WL in</FONT>
<FONT COLOR="#000000">PerformQueuedUnrefs to identify the type of object being released. Put</FONT>
<FONT COLOR="#000000">the C.WL before the g_object_unref call too so you know the type of the</FONT>
<FONT COLOR="#000000">object being "disposed".</FONT>
<FONT COLOR="#000000">I'm considering putting a try/catch around that to throw a useful</FONT>
<FONT COLOR="#000000">exception to at least identify the type being disposed when all hell</FONT>
<FONT COLOR="#000000">breaks loose.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>
--=-vBmBOUuYdt8acGg8Hw0q--