Bug 129152 - Catalogmanager uses 100% CPU and eats up memory
Summary: Catalogmanager uses 100% CPU and eats up memory
Status: RESOLVED FIXED
Alias: None
Product: kbabel
Classification: Unclassified
Component: CatalogManager (show other bugs)
Version: 1.11.2
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Stanislav Visnovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-14 17:06 UTC by Soenke Dibbern
Modified: 2007-04-06 22:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Soenke Dibbern 2006-06-14 17:06:25 UTC
Version:           1.11.2 (using KDE 3.5.3 Level "a" , unofficial build of SUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.10-default

Catalogmanager uses nearly 100% of CPU and eats up my memory, if I have opened a PO in KBabel from it and then leave my machine alone for some time, allowing the screensaver to get active. After reactivating the screen, catalogmanager almost always shows this high activity. If I close the program then, it closes properly. If I let it proceed for a while, the process doesn't stop at closing the window. Memory consumption grows slowly, but steadily.

I used gdb to create a backtrace on such an occasion (though I'm not experienced with it), the first few lines follow. As you can see, it seems to do a kind of endless loop. If you need more portions from the backtrace or additional info, let me know.

This may be the same issue as or may be related to bugs 103173 and 121099, but they regard KBabel rather than Catalogmanager.

#0  0x40ed30b3 in QValueListPrivate<QGListIterator*>::remove () from /usr/lib/qt3/lib/libqt-mt.so.3
#1  0x40ed28fa in QGListIterator::~QGListIterator () from /usr/lib/qt3/lib/libqt-mt.so.3
#2  0x402b54ed in KDirWatchPrivate::emitEvent () from /opt/kde3/lib/libkio.so.4
#3  0x402b59cf in KDirWatchPrivate::restartEntryScan () from /opt/kde3/lib/libkio.so.4
#4  0x402b5b66 in KDirWatchPrivate::startScan () from /opt/kde3/lib/libkio.so.4
#5  0x402b5bf6 in KDirWatch::startScan () from /opt/kde3/lib/libkio.so.4
#6  0x08092b7f in CatalogManagerView::directoryChanged ()
#7  0x08097a8e in CatalogManagerView::qt_invoke ()
#8  0x40c0a039 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3
#9  0x40c0a951 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3
#10 0x402b5241 in KDirWatch::created () from /opt/kde3/lib/libkio.so.4
#11 0x402b52a1 in KDirWatch::setCreated () from /opt/kde3/lib/libkio.so.4
#12 0x402b5658 in KDirWatchPrivate::emitEvent () from /opt/kde3/lib/libkio.so.4
#13 0x402b59cf in KDirWatchPrivate::restartEntryScan () from /opt/kde3/lib/libkio.so.4
#14 0x402b5b66 in KDirWatchPrivate::startScan () from /opt/kde3/lib/libkio.so.4
#15 0x402b5bf6 in KDirWatch::startScan () from /opt/kde3/lib/libkio.so.4
#16 0x08092b7f in CatalogManagerView::directoryChanged ()
#17 0x08097a8e in CatalogManagerView::qt_invoke ()
#18 0x40c0a039 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3
#19 0x40c0a951 in QObject::activate_signal () from /usr/lib/qt3/lib/libqt-mt.so.3
#20 0x402b5241 in KDirWatch::created () from /opt/kde3/lib/libkio.so.4
#21 0x402b52a1 in KDirWatch::setCreated () from /opt/kde3/lib/libkio.so.4
Comment 1 Aaron J. Seigo 2007-04-06 22:02:41 UTC
SVN commit 651172 by aseigo:

this may block the gui briefly (though testers didn't seem to notice in
any case), but most importantly it doesn't crash anymore.
BUGS:119222,129152


 M  +2 -23     catalogmanagerview.cpp  


--- branches/KDE/3.5/kdesdk/kbabel/catalogmanager/catalogmanagerview.cpp #651171:651172
@@ -323,12 +323,10 @@
    if(flag)
    {
       _updateTimer->stop();
-      if( _dirWatch ) _dirWatch->stopScan();
    }
    else
    {
       _updateTimer->start(10000);
-      if( _dirWatch ) _dirWatch->startScan();
    }
 }
 
@@ -1378,7 +1376,6 @@
 	    }
 	} else kdDebug(KBABEL_CATMAN) << "Skipping " << item->poFile() << endl;
 	emit signalSearchedFile(1);
-	kapp->processEvents(10);
 	if( _stop || _stopSearch ) {
 	    _stopSearch = false;
 	    rest.clear();
@@ -1842,11 +1839,7 @@
    while ( it.current() && !_stop)
    {
       it.current()->checkUpdate(true);
-
-      kapp->processEvents(10);
-
-      i++;
-
+      ++i;
       ++it;
    }
 
@@ -1856,11 +1849,7 @@
    while ( dit.current() && !_stop)
    {
       dit.current()->checkUpdate();
-
-      kapp->processEvents(10);
-
-      i++;
-
+      ++i;
       ++dit;
    }
 
@@ -1956,8 +1945,6 @@
 
       for (  it = entryList.constBegin(); it != entryList.constEnd() && !_stop ; ++it )
       {
-          kapp->processEvents(100);
-
 	  if( _stop ) return false;
 
           if((*it)=="." || (*it)=="..")
@@ -2059,8 +2046,6 @@
 
       for (  it = entryList.constBegin(); it != entryList.constEnd(); ++it )
       {
-          kapp->processEvents(100);
-
           if( _stop ) return;
 
           if((*it)=="." || (*it)=="..")
@@ -2143,8 +2128,6 @@
 
       for (  it = entryList.constBegin(); it != entryList.constEnd(); ++it )
       {
-          kapp->processEvents(100);
-
           if( _stop ) return;
 
           if((*it)=="." || (*it)=="..")
@@ -2237,7 +2220,6 @@
 void CatalogManagerView::directoryChanged(const QString& dir)
 {
    pause(true);
-   _dirWatch->stopScan();
 
    QString relDir, relDirPo, relDirPot;
    if(dir.startsWith(_settings.poBaseDir))
@@ -2326,7 +2308,6 @@
       updateDir(relDir);
    }
 
-   _dirWatch->startScan();
    pause(false);
 }
 
@@ -2334,7 +2315,6 @@
 void CatalogManagerView::directoryDeleted(const QString& dir)
 {
    pause(true);
-   _dirWatch->stopScan();
 
    QString relDir, relDirPo, relDirPot;
    if(dir.startsWith(_settings.poBaseDir))
@@ -2432,7 +2412,6 @@
       }
    }
 
-   _dirWatch->startScan();
    pause(false);
 }