Bug 244636 - 100% CPU usage
Summary: 100% CPU usage
Status: RESOLVED NOT A BUG
Alias: None
Product: rekonq
Classification: Applications
Component: general (show other bugs)
Version: 0.5.0
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Andrea Diamantini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 20:15 UTC by Jean-Marie Favreau
Modified: 2010-08-31 16:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
result of "strace rekonq" (476.53 KB, text/plain)
2010-07-14 20:15 UTC, Jean-Marie Favreau
Details
opreport result (16.88 KB, text/plain)
2010-07-28 03:06 UTC, Jean-Marie Favreau
Details
valgrind logs (1) (383.71 KB, application/x-kcachegrind)
2010-07-29 02:28 UTC, Jean-Marie Favreau
Details
Valgrind logs (2) (421.51 KB, application/x-kcachegrind)
2010-07-29 02:32 UTC, Jean-Marie Favreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Marie Favreau 2010-07-14 20:15:02 UTC
Created attachment 49149 [details]
result of "strace rekonq"

Version:           0.5.0 (using KDE 4.4.4) 
OS:                Linux

I previously used rekonq 0.4.0 without problem on my debian sid. After the last upgrade, when I started rekonq, it takes 100% of the CPU, without displaying any windows.
I tried to remove the .kde/share/apps/konqueror, .kde/share/apps/rekonq, .kde/share/config/konquerorrc and .kde/share/config/rekonqrc files, but the problem still exists. I tried with another account on the same computer, and rekonq is able to start correctly.

As you can see in the attached file, I tried "strace rekonq", and it seems that the binary stop during a poll:
"poll([{fd=10, events=POLLIN}], 1, 25000"

I don't know which configuration is different on the two accounts (my original one, and the other without bug).

Reproducible: Didn't try
Comment 1 Jean-Marie Favreau 2010-07-16 11:53:06 UTC
I tried the following approach on the "broken" account:
 - start my kde session
 - "mv .kde/share/ .kde/shareold"
 - start rekonq
The problem still appeared.

I tried also to change the them (from qtcurves to another one), and the problem is still present.
Comment 2 Jean-Marie Favreau 2010-07-18 13:24:43 UTC
I tried to remove the /var/tmp/kdecache-user directory, but the problem still appears.
Comment 3 Benjamin Poulain 2010-07-25 15:41:50 UTC
Could you try to get a profile with oprofile on your rekonq when it is stuck at 100% CPU?

It could help to understand where Rekonq is stuck.

I had similar problems once and the CPU time was spent in the event loop. It was a bug of adobe flash triggering way too many timers (even though no page with flash was open).
Comment 4 Jean-Marie Favreau 2010-07-28 03:04:50 UTC
As you suggested, I used oprofile in order to locate the cpu usage. You'll found attached the result of opreport. It seems that the loop is located into libQtCore.so.4.6.3. I used kcachegrind in order to explore the corresponding trace, and it seems that 81% of the CPU time is dedicated to QEventLoop::processEvents().

Notice that I'm using gnash (not the adobe plugin). Another strange thing is that using "sudo -u jm rekonq" on my broken account makes rekonq working fine.
Comment 5 Jean-Marie Favreau 2010-07-28 03:06:35 UTC
Created attachment 49561 [details]
opreport result
Comment 6 Benjamin Poulain 2010-07-28 11:37:06 UTC
Your trace clearly shows something is overloading the event loop.

You should debug which object is sending/receiving the events and you should have the cause of the problem. 

Callgrind might help here.
To run WebKit with callgrind, you need to add --smc-check=all:
valgrind --tool=callgrind --smc-check=all ./rekonq -graphicssystem raster

The option "--smc-check=all" is needed because of the JIT reusing pages for code.
Comment 7 Jean-Marie Favreau 2010-07-29 02:26:25 UTC
I tried valgrind, and I've seen that gtk_rc_reparse_all_for_settings was one of the function that was using the main part of the CPU time.
I removed gnash from my system, in order to see if it was the reason, but apparently, not.
I attached the callgrind logs. I don't understand why the "sudo -u jm rekonq" is working, since rekonq (directly using the jm account) is not working fine.
Comment 8 Jean-Marie Favreau 2010-07-29 02:28:47 UTC
Created attachment 49606 [details]
valgrind logs (1)
Comment 9 Jean-Marie Favreau 2010-07-29 02:32:12 UTC
Created attachment 49607 [details]
Valgrind logs (2)
Comment 10 Benjamin Poulain 2010-07-29 10:21:21 UTC
All the time is spend because of gtk-qt-engine (libqt4engine) choking the CPU.

The callgrind profile does not have the debug symbols for it so it is hard to say what is wrong in there. It is probably a problem of configuration making the engine enter an infinite loop through the event loop.

> I don't understand why the "sudo -u jm rekonq" is working

The environment variables could be different?

I suggest to close this particular bug report as invalid and to open a new bug report on the bug tracker of gtk-qt-engine.
Comment 11 Panagiotis Papadopoulos 2010-08-31 16:51:44 UTC
@ Benjamin:
Thanks for the help on this :-)