GNOME Bugzilla – Bug 355263
gail_container_ref_child assertion failure
Last modified: 2006-09-25 16:37:56 UTC
Xchat-gnome/atk/gtk+/at-spi/gail/libgail-gnome/at-poke cvs HEAD. Steps to reproduce: 0) Start xchat-gnome 1) At-poke xchat-gnome 2) Close xchat-gnome Results: crash/critical warning on console: ** (xchat-gnome:10543): CRITICAL **: gail_container_ref_child: assertion `(i >= 0)' failed Trace:
+ Trace 72037
VERY weird:
+ Trace 72200
Note that the param is '0' in #3 but has become '-1' when passed to gailcontainer.c... But how did that happen? atk_object_ref_accessible_child: klass = ATK_OBJECT_GET_CLASS (accessible); if (klass->ref_child) return (klass->ref_child) (accessible, i); else return NULL; Something's amiss with this stack trace I suspect, or... ???? Reducing to 'major' severity since it's crash-on-exit.
It seems at-poking is unecessary, just doing start xchat-gnome + quit is enough to trigger the warnings. I think the value of |i| in frame 3 is just gdb not having the info since it's just passed around from frame 4. In frame 4 the value is -1:
+ Trace 72203
243 } 244 gail_container = GAIL_CONTAINER (atk_parent); 245 index = g_list_index (gail_container->children, widget); 246 g_list_free (gail_container->children); 247 gail_container->children = gtk_container_get_children (container); 248 g_signal_emit_by_name (atk_parent, "children_changed::remove", 249 index, atk_child, NULL); 250 251 return 1; 252 } (gdb) p index $11 = -1 That means that the child wasn't found in the gail_container->children list. The widget in question is the menubar, btw: (gdb) p gtk_widget_get_name (widget) $13 = (const gchar *) 0x84118e8 "menubar"
The gail_container->children list comes from a call to gtk_container_get_children. That suggests that either gtk_container_remove is getting called more than once for the widget, or that gail is attempting to remove the widget twice (perhaps due to acting on two different signal types here), OR gtk had already removed the widget from its container list the last time it was refreshed by gail. That last possibility smells like a race condition...
Created attachment 73373 [details] [review] patch to prevent emission of child-removed for objects no longer present in the container. This patch should solve the problem, but I wonder if it is suppressing emission of a notification that should be given?
Since this is happening on exit I think it's reasonable and correct to omit the "children-changed:delete" events. Committing to CVS HEAD.
I confirm that this removed the critical warning on closing xchat-gnome with a11y enabled. Thanks!