GNOME Bugzilla – Bug 419383
high CPU usage in GtkTreeView stuff with a11y enabled
Last modified: 2018-05-24 12:27:50 UTC
Please describe the problem: I've got my music on my home server. under ubuntu feisty rb takes a lot of time to organise the allready indexed library on every start. (Watch folders disabled! Which isn't working at all. Both under feisty and edgy). Steps to reproduce: 1. install ubuntu-feisty. put a lot of music on your local server. 2. connect via ssh2, start rhythmbox the first time, index the music, close rb. 3. start rb. Actual results: Expected results: Does this happen every time? Other information: this here takes a lot of time: ... (16:23:31) [0x80f4028] [rb_entry_view_row_inserted_cb] rb-entry-view.c:1703: row added (16:23:31) [0x80f4028] [rb_shell_clipboard_entries_changed_cb] rb-shell-clipboard.c:804: entryview changed (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Heavy Metal": refcount 207 (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Rammstein": refcount 11 (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Mutter": refcount 11 (16:23:31) [0x80f4028] [rb_entry_view_row_inserted_cb] rb-entry-view.c:1703: row added (16:23:31) [0x80f4028] [rb_shell_clipboard_entries_changed_cb] rb-shell-clipboard.c:804: entryview changed (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Heavy Metal": refcount 208 (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "KING DIAMOND": refcount 8 (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Them": refcount 8 (16:23:31) [0x80f4028] [rb_entry_view_row_inserted_cb] rb-entry-view.c:1703: row added (16:23:31) [0x80f4028] [rb_shell_clipboard_entries_changed_cb] rb-shell-clipboard.c:804: entryview changed (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Heavy Metal": refcount 209 (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Various": refcount 38 (16:23:31) [0x80f4028] [rhythmdb_property_model_insert] rhythmdb-property-model.c:599: adding "Nativity In Black - A Tribute To Black Sabbath": refcount 12 (16:23:31) [0x80f4028] [rb_entry_view_row_inserted_cb] rb-entry-view.c:1703: row added ...
If you could get the output of 'sysprof' or another profiling tool, that would help a lot in figuring out what is causing this. Installing the debug symbols for Rhythmbox (see https://wiki.ubuntu.com/DebuggingProgramCrash#head-dfec77613a7608500efa364c6f6f55c19bfe8aaa) would be necessary. To install sysprof, you need to install the 'sysprof' package and then the kernel module. The kernel module is somewhat more difficult to get, you need to install "module-assistant", run "sudo m-a a-i sysprof-module" then "sudo modprobe sysprof_module". One installed you can run "sysprof" from the terminal, press 'Start', start up Rhythmbox, wait a little while while it's using the CPU, after a few minutes press "Profile", then "Save as" and upload the resulting file. Thanks
Created attachment 84816 [details] sysprof output
That sysprof output does not include debug symbols. Is there any reason to treat this bug as a blocker?
I did, what James told me. How can I include debug symbols?
Installing the following packages would help: libglib2.0-0-dbg, libc6-dbg. And following the instructions on the wiki page I posted a link to, namely adding "deb http://people.ubuntu.com/~pitti/ddebs feisty main" to your /etc/apt/source.list and then installing the "rhythmbox-dbgsym" package. However I think I might know what this is anyway, as I've noticed something similar recently. Do you have accessability turned on for the Gnome desktop? If so, it appears to be GAIL/AT-SPI pulling huge amounts of data from our tree view. Although I've only seen this when trying to quit rhythmbox, and it takes about 45 seconds or so.
Hi, Yes, I have accessability turned on to avoid those very ugly opening and closing boxes for windows. Closing rhytmbox takes a longer time, too.
deactivating accessability lets rb behave correctly!!!
I was hit by that bug, too. But i'd say disabling accessability is just a workaround. So where is the bug located: rhythmbox or gail/at-spi?
*** Bug 551275 has been marked as a duplicate of this bug. ***
Looks like the main thing we need to do is to avoid having query and property models visible (attached to a view) while they're being filled. Each row added to or modified in a visible tree model causes a synchronous corba request to the at-spi registry daemon. I think the slowness on shutdown has more or less the same cause, but I haven't really looked into that yet.
Created attachment 120110 [details] [review] moderately interesting patch This adds a property to RBBrowserSource controlling when the base query model is populated, and uses it to only build the main library query model once the database is loaded. It also only makes query models used in browser sources visible once the backing query is complete. The idea here is to avoid filling query models while they're visible, which is the main cause of slowness with a11y enabled. With this patch, we load and perform searches about as quickly with a11y enabled as with it disabled. There are some visible differences in behaviour that might make things feel a bit slower, though.
I've committed a slightly modified version of that patch that also covers auto playlists too. There's more to do here - browser selection changes probably aren't handled in the same way - so I'm leaving the bug open.
shutdown time is mostly fixed: 2008-10-16 Jonathan Matthew <jonathan@d14n.org> * widgets/rb-entry-view.c: (rb_entry_view_dispose): Remove the model from the tree view, avoiding deletion events for each cell when a11y is enabled; mostly fixes shutdown time. From #419383.
*** Bug 565182 has been marked as a duplicate of this bug. ***
This bug is present in Nautilius (see https://bugs.launchpad.net/nautilus/+bug/159042 ) Also in GRAMPS: http://article.gmane.org/gmane.comp.genealogy.gramps.devel/12372 Is there a way for an application to make sure ATK is not interfering with the treeviews? In GRAMPS the treeview is based on GenericTreeModel. The solution Matthew gives: '''Looks like the main thing we need to do is to avoid having query and property models visible (attached to a view) while they're being filled. Each row added to or modified in a visible tree model causes a synchronous corba request to the at-spi registry daemon.''' is quite artificial for applications.
Without knowing how ATK works, as an application developer I would expect ATK only to react to the signals the GenericTreeView signals. If I change the entire model, ATK should do nothing as long as the app does not signal a row-changed, row-updated or row-deleted event (http://library.gnome.org/devel/pygtk/stable/class-gtktreemodel.html#method-gtktreemodel--row-changed ) After all, that is what those methods are for. My guess is that unattaching then reattaching a model creates quite some overhead on 4000+ treeview, compared to a row-changed event. Or not?
This bug is about rhythmbox. If you want to address nautilus, please open a new bug.
Done: #419383 http://bugzilla.gnome.org/show_bug.cgi?id=419383 If you have reasons to believe this bug is not related to that, please update it. May I further suggest the gnome bug submission system puts the application somewhat more prominent on the bug pages. It is confusing for non GNOME users that there is one bug system, but that it is in reality separately managed.
(actually the new one is bug 587020) The accessibility subsystem is currently being redesigned and reimplemented (replacing CORBA with dbus). I haven't looked at the new implementation in any detail, so I have no idea if it addresses this problem at all. Start here if you're interested: http://live.gnome.org/Accessibility/BonoboDeprecation
Hi, I took a look to this bug as I have a similar problem in other application. Although there are some ATK related comments in the general ATK bug managing this issue (577098), I would want to provide some extra information here: yes, several parts of the accessibility subsystem are being reimplemented in order to fulfill the bonobo deprecation, mainly the at-spi daemon. *But*, I really doubt that this could solve the problem. The object that implements the a11y support for gtktreeview is gailtreeview. It is an AtkObject implementing some extra ATK interfaces. You can see at the line 4243, this method: static void connect_model_signals (GtkTreeView *view, GailTreeView *gailview) { GObject *obj; obj = G_OBJECT (gailview->tree_model); g_signal_connect_data (obj, "row-changed", (GCallback) model_row_changed, view, NULL, 0); g_signal_connect_data (obj, "row-inserted", (GCallback) model_row_inserted, view, NULL, G_CONNECT_AFTER); g_signal_connect_data (obj, "row-deleted", (GCallback) model_row_deleted, view, NULL, G_CONNECT_AFTER); g_signal_connect_data (obj, "rows-reordered", (GCallback) model_rows_reordered, view, NULL, G_CONNECT_AFTER); } For example, the callback model_row_inserted make several things, among them, emit this signal: g_signal_emit_by_name (atk_obj, "row_inserted", row, n_inserted); This is a signal defined by the AtkTable interface: http://library.gnome.org/devel/atk/stable/AtkTable.html#AtkTable-row-inserted An this causes that bonobo call, in order to report the at-spi, so any a11y supporting application could know that. GAIL is not being reimplemented due this bonobo deprecation work, so the behavior will be the same. The only difference is that with the revamped at-spi, it will be a DBUS call instead a bonobo one.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/345.