Bug 215256 - Konversations use 100% cpu doing nothing special.
Summary: Konversations use 100% cpu doing nothing special.
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
: 216016 219280 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-19 11:25 UTC by Alex Fiestas
Modified: 2013-07-01 00:04 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Backtrace of 100% CPU usage problem. (3.50 KB, text/plain)
2009-11-26 18:39 UTC, Eike Hein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Fiestas 2009-11-19 11:25:30 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Well, I'm using KDE trunk with Qt 4.6-RC1 (kde-qt repo), and the problem is pretty well defined in the description. Some times Konversation start to use the 100% of the cpu without human intervention, so maybe have something to be by using the last qt/trunk versions (It didn't happen before).

If I can provide to you more feedback in anyway just ask for it.

Thanks!
Comment 1 Modestas Vainius 2009-11-19 15:50:35 UTC
This only happens with KDE trunk.
Comment 2 Eike Hein 2009-11-19 17:55:27 UTC
This started happening about a week ago when using Qt trunk. Unfortunately I've not been able to reproduce the problem myself using either KDE 4.3.3 on Qt 4.6rc1 or KDE trunk on Qt trunk, but there have been several reports.

David Faure looked at it a bit and had this to say:

<dfaure> Sho_: TZander: I had a quick look at the qtextdocument problem, and it appears that the document size alternates between two widths
<dfaure> like QSize(24,-1) and QSize(48,-1) or something like that. Both of which seem.... really small.

I also have callgrind output from a reporter that I will attach.

I also had a backtrace, but lost it in a system re-setup. It was given as a pastebin in #konversation, so anyone with logs (which I lost, too) please grep them for pastebin URLs, find the one in question and attach the backtrace here.

Amarok seems to have a similar problem with Qt 4.6 trunk, something about spurious resizeEvent()s.
Comment 3 Eike Hein 2009-11-19 18:05:51 UTC
Alright, no attachment because I'm not having any luck compressing it to fit the 1000KB attachment limit, even with xz and lrzip. Link:

http://www.eikehein.com/kde/konversation.callgrind.bug.215256.tar.gz

It was generated by Artur de Souza aka MoRpHeUz on IRC, a KDE developer.
Comment 4 Eike Hein 2009-11-25 07:52:14 UTC
*** Bug 216016 has been marked as a duplicate of this bug. ***
Comment 5 Eike Hein 2009-11-26 18:39:32 UTC
Created attachment 38613 [details]
Backtrace of 100% CPU usage problem.

A new backtrace by mgraesslin of kwin fame.
Comment 6 Eike Hein 2009-11-27 00:43:18 UTC
It appears that temporary work arounds for this problem can include swithing to a monospace font (two successful reports), fiddling with the font size and disabling subpixel hinting (one successful report).

I've filed this issue upstream with Nokia: http://bugreports.qt.nokia.com/browse/QTBUG-6281
Comment 7 Martin Flöser 2009-11-27 09:21:28 UTC
As I am the one who had success with subpixel hinting - here are my settings:

[] Exclude range
[x] Use sub-pixel rendering: RGB
Hinting style: Medium

Before it was on System default and I have no idea what exactly it was. The system became useable again when i deselected the exclude range. So in fact I fixed it by enabling sub pixel hinting and not by disabling
Comment 8 Eike Hein 2009-11-30 23:01:30 UTC
Note from TZander on the callgrind dump:

[22:58] <TZander> Sho_: looking at the valgrind; the scrollbars might be toggled on/off all the time.
Comment 9 Eike Hein 2009-12-19 20:05:11 UTC
*** Bug 219280 has been marked as a duplicate of this bug. ***
Comment 10 Keith Rusler 2009-12-22 17:12:56 UTC
The CPU usage went away with switching to Monospace
Comment 11 Arthur Schiwon 2009-12-23 19:49:04 UTC
Neither Subpixel Hinting settings from Martin Gräßlin nor setting the fonts to monospace ones does not work for me.
Comment 12 matthias sweertvaegher 2010-01-17 12:26:55 UTC
hi, I have the same problem, but I only have this high cpu usage when my kde session starts.
I am on wireless, so konversation first tries a few times connecting before there is network. Then I authenticate in kwallet so the connection can be set up, after that, konversation connects and starts wasting cpu cycles.
When I close the konversation window, the process keeps running and consumes a lot cpu. Then I kill the process and restart konversation: problem solved, no more unusual cpu usage!
Comment 13 Eike Hein 2010-01-21 15:59:44 UTC
Folks, we're getting conflicting reports right now about whether Qt 4.6.1 fixes this problem or not. Could any of you who have upgraded to Qt 4.6.1 chime in here, please?
Comment 14 Rohan Garg 2010-01-21 23:04:09 UTC
Well i can confirm this problem too,i have a Kubuntu 9.10 64 bit install and konversation and nepomuk eat up all my CPU
Comment 15 matthias sweertvaegher 2010-01-24 17:03:42 UTC
hi, just upgraded to qt 4.6.1. the bug is still there. Although I just noticed it stopped using much cpu usage. weird, it seems to 'resolve' after some time.

I just restarted once, and it seems the bug does not happen every time anymore..
Comment 16 Travis McHenry 2010-01-25 08:45:39 UTC
Can everybody try to reproduce this with Settings->Configure Konversation->Interface->Tabs->Focus new tabs turned on?

My understanding of it is this:
Start konversation-> Normal proc usage
Focus any single channel tab -> 100% usage
Scroll through all channel tabs -> Normal proc usage

This setting is just an easy way to focus all the tabs at runtime (also an easy workaround if we can do this in the background)
Comment 17 Travis McHenry 2010-02-02 07:02:30 UTC
commit 625788909b07c101bedd6d4a2e7ef0accfac3dff
Author: Travis McHenry <wordsizzle@gmail.com>
Date:   Mon Feb 1 22:58:20 2010 -0700

    Potentially fix the 100% proc issue
    This commit will hopefully solve the issue many users have been
    having with Qt-4.6.x+konversation+kde4.4. The 100% usage is
    roughly cuased by a lot of scrollbar/relayouting nonsense.
    To prevent this from happening we make it so no recalculating
    needs to occur, by making the horizontal scrollbar AlwaysOff.
    If you experienced this bug please test this and provide feedback.
    CCBUG:215256

diff --git a/src/viewer/ircview.cpp b/src/viewer/ircview.cpp
index 7873801..df01360 100644
--- a/src/viewer/ircview.cpp
+++ b/src/viewer/ircview.cpp
@@ -234,6 +234,11 @@ IRCView::IRCView(QWidget* parent, Server* newServer) : KTextBrowser(parent), m_n
     setServer(newServer);
 
     if (Preferences::self()->useParagraphSpacing()) enableParagraphSpacing();
+
+    //HACK to workaround an issue with the QTextDocument
+    //doing a relayout/scrollbar over and over resulting in 100%
+    //proc usage. See bug 215256
+    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 }
 
 IRCView::~IRCView()
Comment 18 Eike Hein 2010-02-02 07:19:22 UTC
It would be tremendously helpful if everyone listening in here who is capable of building Konversation from the git repos, or is already doing so, would procure the latest version of the sources and give them a try (especially considering the 1.2.2 release at the end of the week). We're hopeful that we found a workaround around the underlying Qt problem that fixes the CPU usage.
Comment 19 Travis McHenry 2010-02-03 16:47:18 UTC
commit 625788909b07c101bedd6d4a2e7ef0accfac3dff
Author: Travis McHenry <wordsizzle@gmail.com>
Date:   Mon Feb 1 22:58:20 2010 -0700

    Potentially fix the 100% proc issue
    This commit will hopefully solve the issue many users have been
    having with Qt-4.6.x+konversation+kde4.4. The 100% usage is
    roughly cuased by a lot of scrollbar/relayouting nonsense.
    To prevent this from happening we make it so no recalculating
    needs to occur, by making the horizontal scrollbar AlwaysOff.
    If you experienced this bug please test this and provide feedback.
    CCBUG:215256

diff --git a/src/viewer/ircview.cpp b/src/viewer/ircview.cpp
index 7873801..df01360 100644
--- a/src/viewer/ircview.cpp
+++ b/src/viewer/ircview.cpp
@@ -234,6 +234,11 @@ IRCView::IRCView(QWidget* parent, Server* newServer) : KTextBrowser(parent), m_n
     setServer(newServer);
 
     if (Preferences::self()->useParagraphSpacing()) enableParagraphSpacing();
+
+    //HACK to workaround an issue with the QTextDocument
+    //doing a relayout/scrollbar over and over resulting in 100%
+    //proc usage. See bug 215256
+    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 }
 
 IRCView::~IRCView()
Comment 20 Eike Hein 2010-02-04 15:27:18 UTC
We now have three independent confirmations that the above workaround is effective in curing the problem. Closing.
Comment 21 David Faure 2013-05-21 15:30:54 UTC
I still see this.
IRCView::resizeEvent is called over and over again. Just put a debug statement in that method, and join silent IRC channels...

17:34:31 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:31 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:31 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:31 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x1e1c2c0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x1d980e0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:32 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x1e1c2c0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x1d980e0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:33 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:34 konversation(20352) IRCView::resizeEvent: IRCView(0x1e1c2c0) QSize(48, 5)
17:34:35 konversation(20352) IRCView::resizeEvent: IRCView(0x1d980e0) QSize(48, 5)
17:34:35 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:35 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:35 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x1bb0b30) QSize(48, 5)
17:34:36 konversation(20352) IRCView::resizeEvent: IRCView(0x1e1c2c0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x1d980e0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2f36eb0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2ea2bb0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2dfe7f0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2d57590) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2ca5eb0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2beefc0) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2b3d340) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2a96650) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x291b320) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x2941900) QSize(48, 5)
17:34:37 konversation(20352) IRCView::resizeEvent: IRCView(0x27dd470) QSize(48, 5)
Comment 22 Eike Hein 2013-07-01 00:01:46 UTC
Hmm, I just tried to replicate this because I was suspicious it could be related to bug 215256, but don't get infinite resize events either in background or active tabs ...
Comment 23 Eike Hein 2013-07-01 00:04:15 UTC
Argh, I meant bug 253560.