Some events cause xfdesktop to hang with high cpu usage and eating memory

Bug #1173849 reported by Ronald
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Xfce4 Desktop
Unknown
Unknown
xfdesktop4 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

During 12.10 I noticed that xfdesktop sometimes caused high cpu usage and started eating memory. The one likely cause was after an update with aptitude and wine starting a new prefix. If I'm not wrong, both actions modify the icon cache and menu entries.

What happens then is as follows: xfdesktop does not respond anymore. Icons are not repainted anymore. The xfdesktop process cannot be killed with SIGTERM, but only with SIGKILL. Furthermore, the process hogs the cpu to 100% and starts eating memory.

On Ubuntu 13.04 I found a reliable way to reproduce this: Right click the desktop. That's all.

An excerpt of top before the right click:

#####
top - 08:57:57 up 12:59, 2 users, load average: 1,54, 1,72, 1,58
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 87,7 us, 11,0 sy, 0,0 ni, 0,0 id, 1,3 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Mem: 507996 total, 479464 used, 28532 free, 11164 buffers
KiB Swap: 2097148 total, 326128 used, 1771020 free, 217280 cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 1389 gebruike 20 0 110m 12m 7464 S 0,0 2,5 0:08.53 xfdesktop
#####

Now I right click and wait 30 seconds:

#####
top - 08:59:16 up 13:00, 2 users, load average: 1,61, 1,70, 1,59
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
%Cpu(s): 51,2 us, 12,5 sy, 0,0 ni, 0,0 id, 35,3 wa, 0,0 hi, 1,0 si, 0,0 st
KiB Mem: 507996 total, 499624 used, 8372 free, 25740 buffers
KiB Swap: 2097148 total, 326068 used, 1771080 free, 153816 cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 1389 gebruike 20 0 198m 100m 7912 R 48,3 20,3 0:35.24 xfdesktop
#####

As you can see, it starts eating memory and using a lot of CPU for (apparently) nothing.

I installed this Ubuntu with cli.seed and then added all the other packages on top. Everything else seems to work fine, except this.

Tags: patch
Revision history for this message
Ronald (ronald645) wrote :

WIth lsof, I found out that thunar starts traversing the entire home directory of this system. E.g.

xfdesktop 5890 gebruiker 20r DIR 8,3 4096 787278 /home/gebruiker/Documenten/Ronald/Drakan/Mountain World/Intro Level
xfdesktop 5890 gebruiker 21r REG 8,3 37232 787284 /home/gebruiker/Documenten/Ronald/Drakan/Mountain World/Intro Level/Intro Objects.ssd

And it traverses towards *everything*, including my kernel source tree (where it stays for a while).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfdesktop4 (Ubuntu):
status: New → Confirmed
Revision history for this message
jimwg (jimwg) wrote :

Ditto. I always thought it was just me even though I reported this around almost a year ago. Just right-clicking for desktop not only kills the conceptual menu but hikes the cpu wild & hot, forget even activating the fixed desktop slideshow feature which locks the cpu to run high and hot even if you log out and in as different users which results in blank (gray) backgrounds; only a total reboot kicks the CPU off. I like Xfce's native slideshow, but this issue is making me resort to directly booting into Wallch, sidestepping desktop. I briefly once "re-set" the CPU by dumping the sessions folder and starting anew, but as sooon as you did the desktop or window tweaks thing the cpu got kicked and culling out sessions all the time was getting laborious. This issue ought be rated highly because it directly affects laptop users because a runaway xfdesktop can literally kill off a third to a half of your battery charge. Pity the unwary!

Jim in NYC

Revision history for this message
Ronald (ronald645) wrote :

I reported this bug directly upstream as well (and there are some candidates for duplicates there as well):

https://bugzilla.xfce.org/show_bug.cgi?id=10138

Since there was (apparently) no response on this one. Upstream is currently filled with bugs like this. I read somewhere that xfdesktop is going to be a plugin of XFCE since they both perform (roughly) the same functions.

And that makes sense, both are designed to show folder contents. Xfdesktop only places it output at the lowest hierarchical level in the window system and disables folder traversing. The rest is the same. However, the plugins repo:

http://git.xfce.org/xfce/thunar-desktop-plugin/

Looks like a stub for now. I really hope this get's of the ground. Unfortunately, it seems that Canonical is currently focusing on Mir and other endeavours atm. Causing these bugs to recieve less attention than one would expect.

What installation method are you using? Xubuntu stock? Or minimal installation as well? Maybe we need another package to prevent xfdesktop from going haywire. I mean, this is not affecting Xubuntu otherwise it would have been fixed right away.

Revision history for this message
Ronald (ronald645) wrote :

Aside from my question above, I have a few more notes:

First, I found a somewhat related debian bug:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636479

But the mentioned fix does not work for me.

Second, once xfdesktop is done traversing trough all my documents (which is a lot, esp on a slow 1250 Mhz machine) then the menu appears! (hurray!).

Could you *please* run a strace as well and attach it to the upstream XFCE bug I reported? (given that it also doesn open calls to .hidden files EVERYWHERE). Thanks.

Revision history for this message
Teresa e Junior (teresaejunior) wrote :

Thank you, Ronald, for posting the solution on the Xfce Bugzilla. For those who are suffering from the same problem, just like I was, edit the file ~/.config/user-dirs.dirs and be sure to set XDG_TEMPLATES_DIR to a small directory, since right clicking on the desktop will scan this directory.

Revision history for this message
Ronald (ronald645) wrote :

I linked the upstream bugreport (I was under the impression this was already the case, hence I was not mentioning my fix here). Thank you Teresa e Junior for alleviating that.

Upstream has created a patch:

- stable: https://bugzilla.xfce.org/show_bug.cgi?id=10138#c5
- upstream: https://bugzilla.xfce.org/show_bug.cgi?id=10138#c4

tags: added: patch
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - Trusty Tahr.

If you need a fix for the bug in previous versions of Ubuntu, please follow the instructions for "Requesting a Backport" at https://wiki.ubuntu.com/UbuntuBackports#Requesting_a_Backport.

Changed in xfdesktop4 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.