Bug 343682 - After resuming, kded4 sometimes eat 100% CPU complaining about org.kde.bluedevilmonolithic
Summary: After resuming, kded4 sometimes eat 100% CPU complaining about org.kde.bluede...
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Unclassified
Component: bluetooth-daemon (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-02 08:44 UTC by Éric Brunet
Modified: 2015-02-08 12:09 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
heaptrack of kded (193.29 KB, text/plain)
2015-02-04 21:28 UTC, Christoph Obexer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Éric Brunet 2015-02-02 08:44:32 UTC
My computer is an up-to-date fedora 21 box, with kde 4.14.3 and (maybe it's relevant ?) still using kdm. [Side remark: bug tracking system did not propose version 4.14.3].

Frequently (but not systematically), kded4 gets crazy when resuming the computer from sleep:
* it eats 100% CPU
* the computer no longer responds to the fn-keys controlling volume, luminosity, etc.
* kded4 writes at a high rate (order of magnitude: 1000 lines per second) on its standard error the line
Error response:  "The name org.kde.bluedevilmonolithic was not provided by any .service files" 

Killing kded4 and restarting it seems to fix the problem until the next time.

It only occurs on a suspend/resume cycle.

Sometimes, the problem appears after I have entered my password and the desktop is up and running. Sometimes, it appears before I can enter my password; the screen locker is then locked and I cannot enter my password. Sometimes (rarely), the screen locker hasn't the time to show up: I see an inactive, non-responding image of my desktop. 
In the two latter cases, I have to switch to a VT, log-in in text mode and kill kded4 there. I can then go back to Xorg to enter my password in the screenlocker, and launch again kded4.

Removing the file   /usr/share/kde4/services/kded/bluedevil.desktop  fixes my problem, but I imagine I am loosing some functionality (I am not really using bluetooth). This file belongs to the package bluedevil. I have had this problem with bluedevil-2.1-1.fc21, and now again
with bluedevil-2.1-2.fc21 which I installed two days ago.

I really don't know how to debug further the interaction of kded4 with bluedevil!

Reproducible: Sometimes
Comment 1 auxsvr 2015-02-03 09:53:14 UTC
Same here on openSUSE 13.1, KDE 4.14.4, bluedevil-2.1-22.2.x86_64. kded4 starts leaking memory at a couple of MB/s after resuming the computer. One way to stop this is to disable bluedevil in the services of kded4.
Comment 2 MartinG 2015-02-03 19:57:22 UTC
I also experience problems with suspend/resume: 
F21 3.18.3-201.fc21.x86_64, kdelibs-4.14.3-8.fc21.x86_64.

I noticed that during a suspend/resume cycle, my .xsession-errors was fed with 46385 lines of 

Error response:  "The name org.kde.bluedevilmonolithic was not provided by any .service files"

and grew by 4.3MB.

I should mention that also sometimes the lock screen does not show on resume (I have "lock screen on resume" activated), and KDE does not respond to mouse or keyboard for a long time. Switching to a VT (ctrl-alt-F2) does work, tough. 
After a while (1-2 minutes I guess), the lock screen is presented, and I am able to log in, but several things does not work, like global keyboard shortcuts.
I assume this is caused by kded being 100 % consumed by this bug.
Comment 3 MartinG 2015-02-03 20:02:37 UTC
Sorry, forgot to mention that I run bluedevil-2.1-2.fc21.x86_64.
Comment 4 Christoph Obexer 2015-02-04 21:28:36 UTC
Created attachment 90915 [details]
heaptrack of kded

during this time kded also uses more memory in the order of a couple MiB/s (heaptrack log attached)

starting bluedevil-monolithic in a console resolves the issue immediately

introduced by https://projects.kde.org/projects/kde/workspace/bluedevil/repository/revisions/8d771c35f2b4f0e0f3ee7ebcf156d461a2dd5eb3 ?
Comment 5 David Rosca 2015-02-07 13:16:44 UTC
Git commit 9d732a65008b54b10ea57eb33ae3648cab1fb41d by David Rosca.
Committed on 07/02/2015 at 13:11.
Pushed by drosca into branch 'master'.

daemon: Don't try to infinitely kill monolithic when it fails

Killing monolithic may fail for various reasons (eg. it may not
be running in the first place). Don't try to kill it again when it
fails.

M  +0    -1    src/daemon/kded/BlueDevilDaemon.cpp

http://commits.kde.org/bluedevil/9d732a65008b54b10ea57eb33ae3648cab1fb41d
Comment 6 Éric Brunet 2015-02-08 12:09:22 UTC
Thank you a lot !

I have downloaded and installed bluedevil-2.1-4.fc21.x86_64.rpm from koji.fedoraproject.org,
and I confirm that it fixes my problem: kded4 now behaves nicely when suspending/resuming.