[Gtk-sharp-list] TreeView causing GTK-Error

Draek draekz at gmail.com
Sat Dec 30 22:57:39 EST 2006


Hey all,

I'm creating a TreeView that contains a Instant Messenger style contact
list, and the data model is synchronized to a list of items from a
server, so the data is manipulated through threads.

For the most part, our application works perfectly, but randomly and
seldom, I will get a complete crash due to a GTK error. The error can
happen to any one of the functions using the TreeStore, so AddContact,
RemoveContact, AddGroup, RemoveGroup are all randomly and seldom,
crashing to this GTK error:

Gtk-ERROR **: file gtktreemodelfilter.c: line 1584
(gtk_tree_model_filter_row_has_child_toggled): assertion failed:
(elt->visible)
aborting...

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Stacktrace:

  at (wrapper managed-to-native) Gtk.TreeStore.gtk_tree_store_clear
(intptr) <0x00004>
  at (wrapper managed-to-native) Gtk.TreeStore.gtk_tree_store_clear
(intptr) <0xffffffff>
  at Gtk.TreeStore.Clear () <0x0001a>
  at <>AnonHelp<81>.<#AnonymousMethod>75 (object,System.EventArgs)
<0x00047>
  at (wrapper delegate-invoke)
System.MulticastDelegate.invoke_void_object_EventArgs
(object,System.EventArgs) <0xffffffff>
  at InvokeCB.Invoke () <0x0001a>
  at (wrapper delegate-invoke) System.MulticastDelegate.invoke_bool ()
<0xffffffff>
  at TimeoutProxy.Handler () <0x0002a>
  at (wrapper native-to-managed) TimeoutProxy.Handler () <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
  at (wrapper managed-to-native) Gtk.Application.gtk_main ()
<0xffffffff>
  at Gtk.Application.Run () <0x00007>
  at Galaxium.Client.Galaxium..ctor (string[]) [0x000d4]
in /home/draek/Projects/Galaxium/trunk/Galaxium.Client/Galaxium.cs:113
  at MainClass.Main (string[]) [0x00000]
in /home/draek/Projects/Galaxium/trunk/Galaxium.Client/Galaxium.cs:43
  at (wrapper runtime-invoke) System.Object.runtime_invoke_void_string[]
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	mono(mono_handle_native_sigsegv+0xde) [0x815644e]
	[0xffffe440]
	/lib/tls/i686/cmov/libc.so.6(abort+0x103) [0xb7d77ef3]
	/usr/lib/libglib-2.0.so.0(g_logv+0x4c2) [0xb7f0e122]
	/usr/lib/libglib-2.0.so.0(g_log+0x29) [0xb7f0e159]
	/usr/lib/libglib-2.0.so.0(g_assert_warning+0x76) [0xb7f0e1d6]
	/usr/lib/libgtk-x11-2.0.so.0 [0xb6d59d4f]
	/usr/lib/libgtk-x11-2.0.so.0(_gtk_marshal_VOID__BOXED_BOXED+0x5d)
[0xb6c7b29d]
	/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x12b) [0xb6e9979b]
	/usr/lib/libgobject-2.0.so.0 [0xb6ea9b93]
	/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8c7) [0xb6eab0b7]
	/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb6eab279]
	/usr/lib/libgtk-x11-2.0.so.0(gtk_tree_model_row_has_child_toggled+0x79)
[0xb6d53699]
	/usr/lib/libgtk-x11-2.0.so.0(gtk_tree_store_remove+0x162) [0xb6d63b12]
	/usr/lib/libgtk-x11-2.0.so.0 [0xb6d63c2f]
	/usr/lib/libgtk-x11-2.0.so.0 [0xb6d63c02]
	/usr/lib/libgtk-x11-2.0.so.0 [0xb6d63c02]
	/usr/lib/libgtk-x11-2.0.so.0(gtk_tree_store_clear+0x43) [0xb6d63c93]
	[0xb514979c]
	[0xb5149753]
	[0xb5149038]
	[0xb6210432]
	[0xb5dc04fb]
	[0xb5dbfb08]
	[0xb5dbfa83]
	[0x8e37d3f]
	/usr/lib/libglib-2.0.so.0 [0xb7f05dd6]
	/usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x182) [0xb7f05802]
	/usr/lib/libglib-2.0.so.0 [0xb7f087df]
	/usr/lib/libglib-2.0.so.0(g_main_loop_run+0x1a9) [0xb7f08b89]
	/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xb4) [0xb6c77574]
	[0xb5dbfa39]
	[0xb5dbf9f8]
	[0xb7402f76]
	[0xb7402b0a]
	[0xb7402a73]
	mono(mono_runtime_exec_main+0x62) [0x80996b2]
	mono(mono_runtime_run_main+0x1b9) [0x8099999]
	mono(mono_main+0xe47) [0x805d477]
	mono [0x805c122]
	/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc) [0xb7d628cc]
	mono [0x805c071]
Aborted (core dumped)

I'm not quite sure what elt-visible means, and I've looking this up on
Google, but am not finding much. Even attempting to search for the error
itself in google is giving me much to work with. Because it happens
randomly, the only thing I can think of, is that I'm performing an
operation on a Iter that is no longer valid.

In order to fix this, I've added checks if(Iter.Stamp != 0) to make sure
its not a zeroed iter, but this only patches the problem in some places,
and still allows for crashing.

An example of a statement that would cause this kind of crash is,

m_aGroupIters.Add(m_oTreeStore.AppendValues(m_oOnlineGroup));

or

m_oTreeStore.Clear();

So this is where i append a item into my list, or remove from, or clear
all. I keep track of the Iters in an array.

Anyone has any ideas how this error comes about for me?

Thanks

Draek



More information about the Gtk-sharp-list mailing list