[Gtk-sharp-list] Crashes at random spots
albright at wesayhome.org
Wed Sep 6 20:16:02 EDT 2006
I received one reply off list that solved my problem. So I'll summarize
It turns out that even when you label your main function with
[STAThread] on a dual-core machine, we get problems with weird crashes.
The solution is to use the following thread idiom: ||
discussion of threads
although it indicates that it is only applicable to multi-threaded
applications, .NET applications are effectively multi-threaded even when
it seems that you are writing a single threaded application.
Eric Albright wrote:
> We have been experiencing crazy random crashes that give us one of the
> messages: "Attempted to read or write protected memory. This is often an
> indication that other memory is corrupt." or "Object reference not set
> to an instance of an object.". The stack indicates that it is trying to
> destroy GTK objects. Our program dynamically generates a form based on
> the data underneath and it consistently happens while iterating through
> records. I tried to reproduce this on my machine at home and was unable
> to which then led me to believe that perhaps there was a threading
> problem since our machines at work are dual core machines.
> I thought perhaps it had to do with interaction with the garbage
> collector on a different thread and so I set gcConcurrent=false in the
> app.config, but this hasn't solved the problem.
> Anyone have any pointers or ideas?
> "Object reference not set to an instance of an object."
> at GLib.Signal.OnNativeDestroy(IntPtr data, IntPtr obj)
> at GLib.Signal.g_object_set_data(IntPtr instance, IntPtr key, IntPtr
> at GLib.Signal.DisconnectObject()
> at GLib.Signal.RemoveDelegate(Delegate d)
> at Gtk.Object.Dispose()
> at Gtk.Alignment.Finalize()
> "Attempted to read or write protected memory. This is often an
> indication that other memory is corrupt."
> at Gtk.Object.gtk_object_destroy(IntPtr raw)
> at Gtk.Widget.Destroy()
> at WeSay.LexicalTools.EntryViewTool.RefreshDetailArea(Box parent) in
> C:\WeSay\src\LexicalTools\EntryViewTool.cs:line 113
> at WeSay.LexicalTools.EntryViewTool.OnPositionChanged(Object sender,
> EventArgs e) in C:\WeSay\src\LexicalTools\EntryViewTool.cs:line 133
> at System.Windows.Forms.BindingSource.OnPositionChanged(EventArgs e)
> sender, EventArgs e)
> at System.Windows.Forms.CurrencyManager.OnPositionChanged(EventArgs e)
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
More information about the Gtk-sharp-list