I've found that krunner sometimes eats all of the available CPU time. It also spawns a dozen of threads as htop shows. If I kill it and restart, everything's back to normal (CPU usage 0.0% and 3 threads). No idea what triggers that though.
I am seeing the behaviour for quite some time. Currently, with kde-frameworks 5.33 and plasma 5.9.4. I am seeing 13 threads of which three take up between 150% and 300%, i.e., up to three CPUs on a Laptop. htop shows VIRT memory usage of 257 G for krunner. After a restart everything is back to normal. When attaching gdb and running a backtrace, I these processes are somewhere below Baloo::DocumentUrlDB::get. I will have to install debugging symbols and come back later for more information, but for all three running instances, the backtrace looks the same up this point.
The backtrace: #0 0x00007fcf94f904e1 in Baloo::DocumentUrlDB::get(unsigned long long) const () from /usr/lib64/libKF5BalooEngine.so.5 #1 0x00007fcf94faa6e1 in Baloo::Transaction::documentUrl(unsigned long long) const () from /usr/lib64/libKF5BalooEngine.so.5 #2 0x00007fcf95404523 in Baloo::SearchStore::exec(Baloo::Term const&, unsigned int, int, bool) () from /usr/lib64/libKF5Baloo.so.5 #3 0x00007fcf953f328f in Baloo::Query::exec() () from /usr/lib64/libKF5Baloo.so.5 #4 0x00007fcf956143a4 in SearchRunner::match(Plasma::RunnerContext&, QString const&, QString const&) () from /usr/lib64/qt5/plugins/krunner_baloosearchrunner.so #5 0x00007fcf95615436 in SearchRunner::match(Plasma::RunnerContext&) () from /usr/lib64/qt5/plugins/krunner_baloosearchrunner.so #6 0x00007fcfa5e99108 in Plasma::AbstractRunner::performMatch(Plasma::RunnerContext&) () from /usr/lib64/libKF5Runner.so.5 #7 0x00007fcfa5c77a78 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib64/libKF5ThreadWeaver.so.5 #8 0x00007fcfa5c766c0 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib64/libKF5ThreadWeaver.so.5 #9 0x00007fcfa5c761c0 in ThreadWeaver::Thread::run() () from /usr/lib64/libKF5ThreadWeaver.so.5 #10 0x00007fcfbfa1efed in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5 #11 0x00007fcfbd2dd374 in start_thread () from /lib64/libpthread.so.0 #12 0x00007fcfbf2d1b2f in clone () from /lib64/libc.so.6
Alright, when trying to reach the end of the function in gdb, it never reaches the end. So, most probably the while (id) loop, which actually is adding to the QByteArray all the time, which might explain the virtual memory. I will check in detail the next time the hang occurs.
Hi! I am having a better backtrace. This backtrace seems to relate to bug https://bugs.kde.org/show_bug.cgi?id=378754 . #0 0x00007f5298b604d9 in QConcatenable<QByteArray>::appendTo ( out=<synthetic pointer>: 0x7f52780e71ca "drive_c/users/user/Meine Dokumente/lib/wine/program/drive_c/users/user/Meine Dokumente/lib/wine/program/drive_c/users/user/Meine Dokumente/lib/wine/program/drive_c/users/user/Meine Dokumente/lib/wine/p"..., ba=<synthetic pointer>...) at /usr/include/qt5/QtCore/qstringbuilder.h:354 #1 QConcatenable<QStringBuilder<QStringBuilder<QByteArray, char>, QByteArray> >::appendTo<char> ( out=<synthetic pointer>: 0x7f52780e71ca "drive_c/users/user/Meine Dokumente/lib/wine/program/drive_c/users/user/Meine Dokumente/lib/wine/program/drive_c/users/user/Meine Dokumente/lib/wine/program/drive_c/users/user/Meine Dokumente/lib/wine/p"..., p=...) at /usr/include/qt5/QtCore/qstringbuilder.h:372 #2 QStringBuilder<QStringBuilder<QByteArray, char>, QByteArray>::convertTo<QByteArray> (this=<optimized out>) at /usr/include/qt5/QtCore/qstringbuilder.h:118 #3 QStringBuilder<QStringBuilder<QByteArray, char>, QByteArray>::operator QByteArray (this=<optimized out>) at /usr/include/qt5/QtCore/qstringbuilder.h:131 #4 Baloo::DocumentUrlDB::get (this=this@entry=0x7f528effc9e0, docId=docId@entry=150699235501735430) at /var/tmp/portage/kde-frameworks/baloo-5.33.0/work/baloo-5.33.0/src/engine/documenturldb.cpp:145 #5 0x00007f5298b7a6e1 in Baloo::Transaction::documentUrl (this=this@entry=0x7f528effca80, id=150699235501735430) at /var/tmp/portage/kde-frameworks/baloo-5.33.0/work/baloo-5.33.0/src/engine/transaction.cpp:104 #6 0x00007f5298fd4523 in Baloo::SearchStore::exec (this=this@entry=0x7f528effcb60, term=..., offset=<optimized out>, limit=<optimized out>, sortResults=<optimized out>) at /var/tmp/portage/kde-frameworks/baloo-5.33.0/work/baloo-5.33.0/src/lib/searchstore.cpp:108 #7 0x00007f5298fc328f in Baloo::Query::exec (this=0x7f528effcc30) at /var/tmp/portage/kde-frameworks/baloo-5.33.0/work/baloo-5.33.0/src/lib/query.cpp:210 #8 0x00007f52991e43a4 in SearchRunner::match(Plasma::RunnerContext&, QString const&, QString const&) () from /usr/lib64/qt5/plugins/krunner_baloosearchrunner.so #9 0x00007f52991e5436 in SearchRunner::match(Plasma::RunnerContext&) () from /usr/lib64/qt5/plugins/krunner_baloosearchrunner.so #10 0x00007f52a75a7108 in Plasma::AbstractRunner::performMatch(Plasma::RunnerContext&) () from /usr/lib64/libKF5Runner.so.5 #11 0x00007f52a7385a78 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib64/libKF5ThreadWeaver.so.5 #12 0x00007f52a73846c0 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib64/libKF5ThreadWeaver.so.5 #13 0x00007f52a73841c0 in ThreadWeaver::Thread::run() () from /usr/lib64/libKF5ThreadWeaver.so.5 #14 0x00007f52c5194fed in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5 #15 0x00007f52c2a53374 in start_thread () from /lib64/libpthread.so.0 #16 0x00007f52c4a47b2f in clone () from /lib64/libc.so.6
https://phabricator.kde.org/D12335