GNOME Bugzilla – Bug 788614
Trying to reuse a TreeViewColumn causes criticals and a segfault (e.g. testtreecolumns)
Last modified: 2017-10-06 23:48:00 UTC
• Run tests/testtreecolumns • Add a new column • Click W to put it in a window • Click Q to remove it from that window • Click W again in an attempt to put it back • SEGV Also, note that ATK is not happy at the start, either. But it doesn't crash. Gtk-Message: Failed to load module "canberra-gtk-module" Gtk-Message: Failed to load module "canberra-gtk-module" (testtreecolumns:20887): Gtk-CRITICAL **: file /home/daniel/jhbuild/checkout/gnome/gtk+-3/gtk/a11y/gtktreeviewaccessible.c: line 295 (get_visible_column): should not be reached Program received signal SIGTRAP, Trace/breakpoint trap. _g_log_abort (breakpoint=1) at /home/daniel/jhbuild/checkout/gnome/glib/glib/gmessages.c:554 554 } (ins)(gdb) cont Continuing. (testtreecolumns:20887): Gtk-CRITICAL **: file /home/daniel/jhbuild/checkout/gnome/gtk+-3/gtk/a11y/gtktreeviewaccessible.c: line 295 (get_visible_column): should not be reached Program received signal SIGTRAP, Trace/breakpoint trap. _g_log_abort (breakpoint=1) at /home/daniel/jhbuild/checkout/gnome/glib/glib/gmessages.c:554 554 } (ins)(gdb) cont Continuing. [New Thread 0x7fbb820d9700 (LWP 20892)] [New Thread 0x7fbb818d8700 (LWP 20893)] (testtreecolumns:20887): Gtk-WARNING **: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg. This may indicate that pixbuf loaders or the mime database could not be found. (testtreecolumns:20887): Gtk-CRITICAL **: gtk_widget_set_parent_window: assertion 'GTK_IS_WIDGET (widget)' failed Thread 1 "testtreecolumns" received signal SIGTRAP, Trace/breakpoint trap. _g_log_abort (breakpoint=1) at /home/daniel/jhbuild/checkout/gnome/glib/glib/gmessages.c:554 554 } (ins)(gdb) bt
+ Trace 238022
but see https://git.gnome.org/browse/gtk+/commit/?id=2c28c627c1527d4ee2dfc4d3805f7afc482049e2 which aimed to fix the leak reported in https://bugzilla.gnome.org/show_bug.cgi?id=728452 (and presumably did, but broke this in turn)
Created attachment 361063 [details] [review] TreeViewCol: Don’t try to disconnect null treeview
Created attachment 361064 [details] [review] TreeViewCol: Don’t null button in unset_tree_view This is asymmetrical: we create the button only via init(), not in _set_tree_view(), so we should not unref it in the latter. Worse, this manifests easily with basic usage of testtreecolumns. compare Commit 2c28c627c1527d4ee2dfc4d3805f7afc482049e2 in master, which aimed to fix the leak reported in Bug 728452 – and presumably did, but broke this in turn. So, it’s back to the drawing board for that bug.
Created attachment 361069 [details] [review] TreeViewCol: Fix SEGV on remove/add, + memory leak Nulling priv->button in _unset_tree_view() is asymmetrical: we create it via init(), not _set_tree_view(), so we shouldn’t null in the latter. Worse, doing so manifests in criticals + a SEGV easily with basic use of testtreecolumns, removing the TVC from a TV then trying to add it to one Finally, the wrong null-out meant dispose() failed to unref the button, so it leaked. https://bugzilla.gnome.org/show_bug.cgi?id=728452 -- updated the message to reflect that this seems to fix the problem outlined in Bug 728452, i.e. column buttons not being disposed on quitting testtreeview. testtreecolumns does not seem to fare so well, but that might just be it blazing straight into gtk_main_quit() without properly destroying everything on the way.