[hardy] kded in loop (100%CPU) when using 'mount automatically'

Bug #194474 reported by Etienne on 2008-02-22
102
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kdelibs
Invalid
Medium
kdebase (Ubuntu)
Undecided
Jonathan Riddell
Hardy
Undecided
Unassigned

Bug Description

Binary package hint: kdelibs4c2a

Hi,
I have/test Hardy since the 4. Alpha.
If i plug in a USB Device after i wake the Laptop from Suspend (In my case a MyBook-Harddrive) kded uses all resources (top shows 95%CPU only caused by kded).
It also happens when i just remove the USB-Harddisc and replugin it.
So i'm not able to use USB Drives twice in one session.
I can only stop kded when i reboot the hole system.

Hardware: Thinkpad T43p

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu hardy (development branch)"

||/ Name Version Beschreibung
+++-=========================================-========================
ii kdelibs4c2a 4:3.5.9-0ubuntu1 core libraries and binaries for all KDE applications

If you need more Information, tell me.
Regards
Eti

Related branches

Etienne (etienne-rebetez) wrote :
Etienne (etienne-rebetez) wrote :
description: updated

I think i figured out how to triger that bug.
-Start Kubuntu (USB Device is unpluged)
-When loggen in in KDE, plugin USB Device.
-kded will try to do somthing, and beginn to loop. (CPU >95%)

That only hapens with my WD MyBook 300GB and the iPod 4th gen 20GB.
If i plugin both Devices BEFORE i boot, i am able to Mount them and use them normaly.

My Memorystick and the other USB Harddrive (mevis 300GB) works well.

Can anybody confirm that?

KeKc (kekcfx) wrote :

I confirm this. Unfortunately I have just created a bug #196005, it is a duplicate ow, I guess.
Etienne, I have discovered, that it only happens with devices for which you select "Automatically mount" in their properties.

Changed in kdelibs:
status: New → Confirmed
Etienne (etienne-rebetez) wrote :

Thanks, KeKc. Yes i checked the "Automatically mount" flag. And it fits with the MyBook and the iPod... Now the work fine.
So it's the same as in gutsy, the Drives/Sticks doesn't mount automaticly. (But that is another Story)

It would be fine if you could set the "Automatically mount" option and that the devices still work.

Here is another dublicate: https://bugs.launchpad.net/ubuntu/+source/kdelibs/+bug/196224

yes, I've found that it works on first run, ie when kded first starts. Or if you killall -9 kded and restart kded it will mount them correctly, but after kded is already running and you plug in a device with 'mount automatically' selected it goes into 100% cpu condition.

strace shows that it tries to write apparently to dcopserver right before this happens, then nothing else is reported.

lanzen (lanzen) wrote :

Right, I'm seeing this happening since I've udated to kde 3.5.9 and still in Gutsy.

I'll try removing the "Automatically mount" option and see it it solves it.

lanzen (lanzen) wrote :

Right on! Thank you KeKc, it worked!

Geoffrey (geoffrey-metais) wrote :

I have the same problem.
But kded takes all the cpu even at first attempt.

I cannot mount my psp at all with kubuntu. With an USB key it works

I don't know how to remove the automount option when kde cannot display the device.

I suffer this since kde 3.5.9 upgrade on gutsy, same issue with kde 3.5.9 on hardy

FriedChicken (domlyons) wrote :

Yes, I've got the same problem on Gutsy since KDE 3.5.9 upgrade.

Changed in kdelibs:
status: Unknown → New
Justin Chudgar (justinzane) wrote :

Just upgraded to Hardy; and, now my USB mass storage MP3 player triggers this bug. Seems to happen with both the 2.6.22 and 2.6.24 kernels. My info is attached. Note that this only shows the try with 2.6.22. Same problem with 2.6.24.

playmobil (f-bresson) wrote :

Same problem since kde 3.5.9

Albert Astals Cid (aacid) wrote :

Just want to say that this is not a KDE problem but a KUbuntu problem since they are patching KDE to act this way.

Running KDE 3.5.9 with Hardy (last update & reboot May 18 2008).

I have the same problem. If I plug in an external HD, kded goes to 100% CPU consumption. Sometimes, even without an external disk or USB, kded will also go to 100% and stay there.

Worth noticing that I can't start konqueror when kded goes mad like that.

Killing it with signal 15 doesn't work. To kill I have to use 9.

Albert Astals Cid (aacid) wrote :

This bug is not in kdelibs but in kdebase, the bug is caused by kubuntu_9913_kiomedialuks.diff

Asraniel (asraniel) wrote :

Is this going to be resolved? i cannot install hardy for my girlfriend as long as such bugs are still around

perhaps that can be corrected Kubuntu is not an LTS so bigger correction can be done. We can hope at least.

It's me or Hardy seems to be unfinished?

That's kind of unfair, I don't think anyone can call any operating system, or
any software these days "finished" in the sense that it's bug free.

I do find some bugs like this annoying because they tend to be brushed aside
because kubuntu has a vision of making their own way of doing things and if
it breaks the way kde works so be it.

Nick Sanders (nicksanders11) wrote :

I had a problem with kded racing when inserting media (cd and usb) and I deleted .kde/share/config/?.kde/share/config/mediamanagerrc and I haven't changed any media related settings since then and it hasn't come back (the problem or the file).

Changed in kdelibs:
status: New → Invalid
Sinnerman (sinnermann) wrote :

Same here. I need my USB-Devices!!

This is a complete showstopper for me, as my daily backups require my external drive to be switched on and attached, which immediately causes kded to go wild and screw the rest of the system.
Unless there's a fix very fast, I'm going to have to revert to Feisty :-(

Same bug here. Hope this gets high priority and a fix as soon as possible, as bugs like this are total showstoppers for desktop centric distributions like Kubuntu.

Gobnuts (gobnuts) wrote :

Same Problem for me. Noticed it first when I upgraded to KDE 3.5.9 on gutsy and the problem is still there under hardy.
This is a complete show-stopper for me as well. I certainly can't upgrade my desktop if my usb-devices don't work reliably (e.g. external hard-drive & ipod).

Geoffrey (geoffrey-metais) wrote :

A workaround for me was to deselect the 'automount' option when I came back on gusty (witing for hardy release).

I can use my PSP on hardy without any issue because now it's not automouted.

I first tried to deactivate this option by editing the concerned config file but I did not find it.

davebv (dave-bv) wrote :

I confirm the problem still exist in hardy. big problem when I plug 2 external drives

Gobnuts (gobnuts) wrote :

I can confirm Geoffrey's workaround, de-selecting the automount works. But after mounting the device manually, KDE can't eject the device. I have to manually eject it with "sudo eject /dev/sd* ".
Although this works, it is rather annoying.

Trey Hunner (treyhunner) wrote :

I confirm this problem still exists. This is a big problem for both my external drive and my iPod.

brian_w (linuxbugs) wrote :

Nick Sanders wrote on 2008-04-24 about deleting the mediamanagerrc file found in the .kde/share/config/ folder.

I had a look in mine, and found a specific entry that related to the usb drive that locked up the system whenever it was inserted. I deleted that item only (as there were other bits in there that seemed to be needed in my case) and all has been fine since.

Whilst not perhaps dealing with the root cause/problem, this seems a possible workaround, so thank you Nick.

For interest and possible bug tracing, the entry removed was:

[/org/freedesktop/Hal/devices/storage_serial_WD_5000KS_External_57442D574D414E5531303938323230_0_0]
automount=true

Hope this helps others.

Jonathan Riddell (jr) wrote :

Attaching a patch which fixes this, I need to work out exactly what that problematic while loop is for though to decide if removing it breaks anything.

Jonathan Riddell (jr) wrote :

attaching package for people to test.

luisromangz (luisromangz) wrote :

Jonathan, the package you have attached solves the problem here, no more high CPU usage when the automount flag is set for an USB drive.

Carl (carl-kde) wrote :

Jonathan, your package has solved the problem with my usb key : no more kded with 100% CPU.

New package works well for me. On storage devices with multiple partitions,
however, if you select to automount one partition they will all be mounted
automatically. Still - better than looping.

Thanks Jonathan

Gobnuts (gobnuts) wrote :

Installing the package caused konqueror to be uninstalled (plus a few other things). apt wouldn't let me re-install konqueror, claiming it was broken. The mount seems to work but I still had to eject the device from command prompt.

Martin Lubich (mlubich) wrote :

Installation of the package is not correctly working for me either.
After installing the package with GDebi my system was left with broken packages.
Doing an apt-get install -f to fix the broken packages gives me the following suggestion:

<code>
The following packages will be REMOVED:
  kdebase kmplayer-konq-plugins konq-plugins konqueror konqueror-nsplugins kubuntu-desktop
  strigi-applet
</code>

I did not accept these changes and went back to the original version of kdebase-kio-plugins.

@Gobnuts:
The eject problem is not related to this bug, as it seems that it is a permission problem on the device after it is unmounted but not yet ejected. As a workaround add group disk to your account and the eject should work again. ( at least it did for me ...)

Gobnuts (gobnuts) wrote :

What happened to Martin is exactly what happened to me as well.

The eject-issue has been solved by adding the "disk" group to my user-account, just as Martin suggested.

@Martin: Thanks! Worked for me, too. :)

Asraniel (asraniel) wrote :

ok, all this is nice and cool, but we are talking about a LTS release here, how do we get the fixes into hardy?

Henrik Pauli (ralesk) wrote :

@asraniel: hardy-updates repository I guess.

Jonathan Riddell (jr) wrote :

Here is a better fix, still runs the code but only if it is needed (the drive is encrypted).

Jonathan Riddell (jr) wrote :

Here is the compiled module for people wanting to test. It goes into
/usr/lib/kde3/kded_mediamanager.so you will need to log out and in again to test.

Jonathan Riddell (jr) wrote :

Testing:
Insert unencrypted USB drive, right click on it in media:/ in Konqueror, Properties, mounting, tick auto-mount.
install updated .so file or kdebase-kio-plugins package
log out and back into KDE
insert USB drive
use top to see if kded uses 100% CPU, if it doesn't it'll show the popup and open in Dolphin or Konqueror.

Also test that a LUKS drive formatted as per http://www.emcken.dk/weblog/archives/164-Encrypted-USB-drive-in-Ubuntu.html still mounts.

Jonathan Riddell (jr) wrote :

Uploaded kdebase/4:3.5.9-0ubuntu7.1 to hardy-proposed, waiting for approval.

Asraniel (asraniel) wrote :

thank you jonathan, loving the work you do with kubuntu.
Since you just looked at the code of mounting etc, there is a trivial bug that could probably be easely fixed, and would make kubuntu look much more professional (and would stop annoying my girlfriend ;-))
https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/222041

Martin Pitt (pitti) wrote :

Accepted into hardy-proposed, please test.

Changed in kdelibs:
status: New → Fix Committed
assignee: nobody → jr
status: Confirmed → In Progress
FriedChicken (domlyons) wrote :

It works! Thank you!

Martin Lubich (mlubich) wrote :

Tested the kded_mediamanager.so binary.

All tests worked out fine so far, no problems encountered.
Thank you, for fixing this.

Alvaro Carroz (alvaro-carroz) wrote :

Just tested it. Works perfectly.
Thank you so much.

Carl (carl-kde) wrote :

@Martin Lubich : how did you go back to the previous kdebase-kio-plugins version ? i can't use adept anymore (i don't want to remove kubuntu-desktop, konqueror, etc.)

Martin Lubich (mlubich) wrote :

@Carl

I do not use adept, but synaptic. But anyways, I think you should be able to do the same.
I used the 'Force Version' command from synaptic to go back and reinstall the original kdebase-kio-plugins package. After that I had had no more broken packages and no complaint from the packaging system.

Carl (carl-kde) wrote :

Thanks, adept doesn't seem to do that.
I manage to solve my problem with :
sudo apt-get install kdebase-kio-plugins=4:3.5.9-0ubuntu7

That package seems to need a provides so it doesn't want to remove konqueror and some other kde packages.

FWIW:

Installed the proposed update package, and it works for me as well.

Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in kdebase:
status: Fix Committed → Fix Released

Updates installed and apparently working perfectly.

Thanks to all involved for your efforts fixing this; lucky it wasn't a bug in Vista, we'd still be waiting for a fix next year...

crvampsh (crvampsh) wrote :

I'm getting an update with adept updater updating to kdelibs4c2a 4:3.5.9-0ubuntu7.1
Error states "There was an error commiting changes. Possibly there was a problem downloading some packages or the commit would break packages."

crvampsh (crvampsh) wrote :

FYI: I changed my apt sources from the mirrors back to the defaults and it resolved my problem. Thanks.

Martin Pitt (pitti) wrote :

Intrepid uses KDE 4, which is a different code base.

Changed in kdebase:
status: In Progress → Invalid
Changed in kdelibs:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.