! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Desktop window frozen at startup with maximum CPU usage
Status:
RESOLVED: FIXED
Severity:
blocker
Product:
Xfdesktop
Component:
General

Comments

Description Maxime Bochon 2015-05-05 22:37:34 CEST
Created attachment 6234 
xfdesktop-setting frozen at startup (window enlarged, content not updated, CPU full on 1 core, strange blue bar)

xfdesktop-settings is frozen at startup with maximum CPU usage on Ubuntu Studio 14.4.2 LTS.

By 'frozen' I mean : the content of the window is drawn, I can see tabs, items, lists, buttons, but I cannot interact with any of them. The window can be enlarged but the content is not rendered again to fit the new window dimensions.

By 'at startup' I mean : directly after being launched either via the right click menu on the desktop, or by command line. The behaviour is the same with the regular kernel and the real-time kernel.

By 'with maximum CPU usage' I mean : my CPU graph indicator shows 50% usage so one of my 2 cores is used at full throttle (my CPU is an Intel Code 2 Duo). I left the program 10 minutes before killing it.

On the screenshot a strange blue bar can be seen next to the thumbnail. I don't know what it is for.
Comment 1 Maxime Bochon 2015-05-05 22:40:29 CEST
If some strace/debug infos are needed, please feel free to ask.
Comment 2 Eric Koegel editbugs 2015-06-03 17:35:55 CEST
Hey! Sorry to take so long to respond. Can you run xfdesktop-settings -e from the command line? You can also try an strace and see if it pulls up anything else useful. Thanks!
Comment 3 Keith 2015-06-10 02:11:10 CEST
I am experiencing similar problems with xfdesktop-setting on Debian Sid / Siduction Xfce, 32bit. Xfce 4.12.2

The window launches frozen, one CPU will max out at 100%, and nothing on/in the window is clickable. I have to right-click for a menu, click "close", and it takes about 10 seconds for another window to pop up that says "This window might be busy and is not responding. Do you want to terminate the application?"

I've tried launching it from a panel launcher, main menu, the .desktop file in usr/share/applications, terminal, and root terminal. All results are the same.
Comment 4 Keith 2015-06-10 02:29:42 CEST
Sorry, I just noticed this bug report is for Xfce 4.11.8. I'll start a new report on Xfce 4.12.2.
Comment 5 Maxime Bochon 2015-06-11 22:10:49 CEST
Created attachment 6308 
debug trace

This is a copy of the standard output when I ran xfdesktop-settings with debug mode enabled. At the end I had to close the window with top right cross and accept a forced closing.
Comment 6 Maxime Bochon 2015-06-11 22:24:07 CEST
Created attachment 6309 
syscall trace

I traced system calls like this:
strace -o"xfdesktop-settings_strace-f.txt" -f xfdesktop-settings -e
Comment 7 Maxime Bochon 2015-06-11 22:32:12 CEST
(In reply to Eric Koegel from comment #2)
> Hey! Sorry to take so long to respond. Can you run xfdesktop-settings -e
> from the command line? You can also try an strace and see if it pulls up
> anything else useful. Thanks!

Hi Eric,

I just added two attachments :
 1. the debug trace
 2. the syscall trace

In the first I didn't see anything suspicious.

The latter it's like there are waits on event(s) that doesn't respond:

...
8756  eventfd2(0, O_NONBLOCK|O_CLOEXEC) = 9
...
8756  brk(0x7fea32cda000)               = 0x7fea32cda000
8758  <... poll resumed> )              = 0 (Timeout)
8758  read(9, 0x7fea1279fb10, 16)       = -1 EAGAIN (Resource temporarily unavailable)
8758  poll([{fd=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 995 <unfinished ...>
8756  brk(0x7fea32d1c000)               = 0x7fea32d1c000
...

This is one clue and I didn't go further. I hope you'll find something relevant in the trace.
Comment 8 Eric Koegel editbugs 2015-06-14 15:16:12 CEST
Created attachment 6310 
Remove preview thread when needed

Thanks! Can you see if this patch improves things?
Comment 9 Eric Koegel editbugs 2015-06-21 11:01:22 CEST
Created attachment 6319 
Settings: Fix loading of wallpaper previews

The last patch didn't fix anything. Can you try this new patch? Also if it doesn't work, can you run

xfdesktop-settings --enable-debug

from the command line and provide that debug trace? I added more debug messages to help ensure the problem is where I think it is.
Thanks!
Comment 10 Maxime Bochon 2015-06-21 16:31:27 CEST
I first tried patch 2 the normal way. It didn't solve the problem. And when I tried to force the closing of the window, Xorg CPU usage climbed to 100% and I had to kill it.

The second time, I enabled the debug mode (see attachment). The behaviour was the same. To prevent freezing Xorg, I closed xfdesktop-setting from command line with CTRL+C keyboard shortcut.
Comment 11 Maxime Bochon 2015-06-21 16:32:56 CEST
Created attachment 6322 
debug trace for patch 2
Comment 12 Maxime Bochon 2015-06-21 16:47:33 CEST
Created attachment 6323 
xfdesktop-setting frozen at startup (alternative rendering)
Comment 13 Maxime Bochon 2015-06-21 16:49:41 CEST
Created attachment 6324 
xfdesktop-setting works well when launched with valgrind
Comment 14 Maxime Bochon 2015-06-21 16:53:58 CEST
I just found a workaround: when xfdesktop-settings is launched using valgrind, it works (all previews appear and I was able to change my desktop picture).

Attachments:
 - a screenshot showing xfdesktop-settings working well
 - a debug trace when xfdesktop-settings is launched using valgrind
Comment 15 Eric Koegel editbugs 2015-06-21 17:29:15 CEST
Created attachment 6325 
Settings: Fix loading of wallpaper previews

So it is a concurrency issue. Let's just use an idle callback to load the thumbnails. It also prints out when it loads the thumbnail (or the file if thumbnailing failed which is even slower). Let me know if this finally fixes it for you!
Comment 16 Maxime Bochon 2015-06-21 19:44:30 CEST
It works now with patch 3. Thanks!
Ask me if you need more thorough testing...
Comment 17 Eric Koegel editbugs 2015-06-21 20:36:22 CEST
Awesome, thanks for the help with testing this. Pushed to master in:
commit 6da71e3771f7e7dad276d4ca78014d0d1695f788
Author: Eric Koegel <eric.koegel@gmail.com>
Date:   Sun Jun 21 18:12:52 2015 +0300

    Settings: Fix loading of wallpaper previews (Bug #11892)
    
    Use an idle callback rather than threads for the wallpaper images.
http://git.xfce.org/xfce/xfdesktop/commit/?id=6da71e3771f7e7dad276d4ca78014d0d1695f788

Bug #11892

Reported by:
Maxime Bochon
Reported on: 2015-05-05
Last modified on: 2017-03-17

People

Assignee:
Eric Koegel
CC List:
4 users

Version

Version:
4.11.8

Attachments

Additional information