polkitd service is using all my RAM

Bug #572813 reported by VasiaUVI
194
This bug affects 38 people
Affects Status Importance Assigned to Milestone
PolicyKit
Fix Released
Undecided
Unassigned
policykit-1 (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Lucid by Toby Corkindale
policykit-1 (openSUSE)
Fix Released
Medium

Bug Description

Binary package hint: policykit-1

I'm using Lucid Lynx!
After starting my laptop the polkit service is using less than 2MB but using 30% from my both CPU's. Progressively with time passing by the polkitd service is using a lot of memory (up 600MB) until my system bacame unresponsive!
First I've thought that this memory leak is because of xorg https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+bug/569711 but I've seen that this polkitd is taking all the CPU and RAM!

As I write the service takes 150MB and with time will arrive at >500MB.
How to stop, remove, kill, destroy, repair this service?
Thanks!

Revision history for this message
James Westby (james-w) wrote :

I suspect this is a duplicate of bug 570015.

Thanks,

James

Revision history for this message
VasiaUVI (vasiauvi) wrote :

I've managed to not have this problem again!
I've deleted from /home the .pulse folder and after this was everything OK.

Revision history for this message
ajeshp (ajesh-prabhu) wrote :

Removing .pulse folder from /home also worked for me

Revision history for this message
Toby Corkindale (tjc-wintrmute) wrote :

I frequently see this behaviour as well - I had intuitively grasped that it was somehow related to pulseaudio too, but hadn't tried removing the .pulse folder..

Still, that shouldn't be causing polkitd to spiral out of control, no matter what!

tags: added: lucid
tags: added: pulseadio
Revision history for this message
Douglas Moyes (aragorn-stellimare) wrote :

Same here. I was going to simply remove the package, but it's tied to pretty much all the vital packages for the gnome desktop.

Within 5 hours my system becomes unresponsive. This morning, when trying to log back into my computer at work, my system was unresponsive. I had to just restart to clean everything up.

The only way to keep the system stable is to loop-kill polkitd, since gnome insists on restarting the stupid thing. I have created a startup script that'll work as a band-aid fix to keep systems from crashing, but it's not a solution.

As for thoughts about this being related to puleaudio... removal of the .pulse directory achieved nothing. Attempt to remove pulseaudio also results in the same crash.

At this point, I'd have to say the best course of action is to roll back GNOME to the version used in 9.10, which worked. Right now, systems are unstable because of this.

Revision history for this message
Douglas Moyes (aragorn-stellimare) wrote :

Okay.. so I moved ~/.[a-z]* to a backup folder, then moved .mozilla* .thunderbird .purple, .openoffice.org .bashrc .viminfo .wine .dosboxrc back to ~ and... now polkitd is no longer showing up on top, and my system is now stable again.

So.. Looks like the dis-upgrade should change it's behaviour somewhat and move users's gnome-related .* files to a backup directory, and everything will be peachy.

and no, simply nuking .pulse didn't do the trick.

Still, there is an issue with polkit that needs to be resolved so this isn't an issue in the future. Good news is, there is a fix.

Revision history for this message
David Futcher (bobbo) wrote :

Confirming. This is hitting me in Maverick. I nuked my ~/.pulse directory but polkitd is still taking up far too much RAM & CPU. Raising importance to medium to get some eyes on this.

Changed in policykit-1 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Wesley Channon (wesleychannon) wrote :

I noticed a ~/.pulse-cookie file as well as a ~/.pulse directory on my system.

I removed the .pulse directory first - this did not improve things.
After I removed the .pulse-cookie file things appeared to be fine.

On both occasions, I killed the polkitd process afterwards.

Hope this helps.

Revision history for this message
rojer (rojer9) wrote :

i removed .pulse-cookie - no change. haven't tried removing .pulse as it seems pointless - as you can see from attached strace, it does not touch any of the fiels in user's directory. instead, it seems to be stuck in some sort of config reload loop: load configs - sleep for a while - load configs - sleep... it is during this cycle that RSS growth happens - a few kilobytes each time. over long period, this adds up.

Joel Ebel (jbebel)
tags: added: glucid
Revision history for this message
Phill Whiteside (phillw) wrote :

from reading the comments and having a pretty much un-responsive system I just 'nuked' the directory using sudo. The result on CPU usage was immediate. It's hardly a solution though. If any dev wants additional information, please feel to ask.

Revision history for this message
Michał Ćwikliński (mcwiklinski) wrote :

I've got the same problem in Lubuntu - my CPU is over 80% load, but there is no process, which eats so much resources

Revision history for this message
Steve Hikurangi-Species (nostrasteve) wrote :

Yeah it's annoying as hell getting swapped to death every hour. It only started doing it after I `rm -rf /etc/pulse` to make audio work again. `rm ~/.pulse*` has no effect.

Revision history for this message
In , flan_suse (flansuse) wrote :

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.55 Safari/534.3

The polkitd process, which runs as root, starts at 4 MB of reserved memory, but will gradually balloon to giant levels, such as 250 MB and beyond. If I kill the process (kill -9) in runlevel 3, then return to runlevel 5, it once again starts at 4 MB, but it will grow to the same levels if left unchecked.

I have deleted my ~/.pulse and ~/.dbus directories, but it made no difference.

Reproducible: Always

Steps to Reproduce:
1. Use the system normally.
Actual Results:
The polkitd process will consume more memory than it should. Eventually, if left alone long enough, the system will be forced to use swap, and if still left alone, the system will begin to crawl.

Expected Results:
The polkitd process should not consume enourmous amounts of RAM.

openSUSE 11.3
x86_64
2.6.34.4-0.1-desktop
Latest updated packages.

Revision history for this message
In , Kasievers (kasievers) wrote :
Revision history for this message
In , flan_suse (flansuse) wrote :

(In reply to comment #1)
> Seems like this issue:
> https://bugs.freedesktop.org/show_bug.cgi?id=29069

I hope this is the same problem, because if it is, that means the bug was fixed in version 0.98 of polkit. Will it hit the repo for opensuse 11.3?

Revision history for this message
In , Kasievers (kasievers) wrote :

(In reply to comment #2)
Will it hit the repo for opensuse 11.3?

No, I don't think we can do that, it has too many dependencies. Dependencies which are not even fixed in Factory at the moment.

The only option for now is to find the leak in the 11.3 version, which is pretty different code from the current one.

Revision history for this message
In , Kasievers (kasievers) wrote :

The current Factory version seems to leak here:

malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
g_malloc (in /usr/lib64/libglib-2.0.so.0.2515.0)
g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.2515.0)
g_hash_table_new_full (in /usr/lib64/libglib-2.0.so.0.2515.0)
??? (in /usr/lib64/libpolkit-gobject-1.so.0.0.0)
g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.2515.0)
??? (in /usr/lib64/libgobject-2.0.so.0.2515.0)
g_object_newv (in /usr/lib64/libgobject-2.0.so.0.2515.0)
g_object_new (in /usr/lib64/libgobject-2.0.so.0.2515.0)
polkit_action_description_new (in /usr/lib64/libpolkit-gobject-1.so.0.0.0)
polkit_backend_action_pool_get_action (in /usr/lib64/libpolkit-backend-1.so.0.0.0)
polkit_backend_action_pool_get_all_actions (in /usr/lib64/libpolkit-backend-1.so.0.0.0)

Revision history for this message
In , flan_suse (flansuse) wrote :

I can confirm that the same thing occurs on a fresh new installation of openSUSE 11.3 i586 on a different machine. I hope this can be fixed relatively soon. It's a serious leak and "don't use the computer for too long before rebooting" isn't an appealing option. This can be a detour for users from Windows or other distros.

Revision history for this message
In , flan_suse (flansuse) wrote :

Could this be somehow GNOME-related?

I also noticed that on two other computers this problem does not exist. They are using KDE.

The computers that suffer from this issue are using GNOME and Xfce. (The Xfce system formerly was GNOME in the beginning, and some GNOME packages and libraries are still installed.)

Revision history for this message
guillaume le louet (guillaume-lelouet) wrote :

Don't delete the /etc/pulse if you don't know EXACTLY what you do. If you delete /etc/pulse, then you crash you pulseaudio server configuration, meaning it will infinite-loop start/crash.

Had the same bug after installing the maverick RC on a maverick update from lucid. rm -rf $HOME/.pulse worked fine.

Revision history for this message
VasiaUVI (vasiauvi) wrote :

@guillaume le louet
Yes, the /etc/pulse should NOT be deleted, only the /home/.pulse.
Thank you that you've pointed out that this bug is also in the maverick.
I will upgrade soon and it's good to know that this bug has not been fixed.

Revision history for this message
In , Hvermeulen (hvermeulen) wrote :

Same issue here.
OpenSUSE 11.3 x86_64 fully patched.

Revision history for this message
In , flan_suse (flansuse) wrote :

(In reply to comment #7)
> Same issue here.
> OpenSUSE 11.3 x86_64 fully patched.

Just curious. Are you using KDE or GNOME?

Revision history for this message
In , Hvermeulen (hvermeulen) wrote :

I am on Gnome.
Disabling Pulseaudio immediately solved the issue.

But then I have issues with multimedia :-) lovely...

Revision history for this message
In , flan_suse (flansuse) wrote :

For the KDE systems, none of them have pulseaudio enabled, and none of them have the polkitd memory leak problem.

The GNOME system has pulseaudio enabled and installed, and it suffers from this memory leak.

Looks like pulseaudio may be the culprit (again...) for this issue.

But then here's what is odd. On my Xfce system, pulseaudio is disabled, and it's not even installed. The only pulse packages I have are:

libpulse0-32bit-0.9.21-10.1.1.x86_64
libpulse-mainloop-glib0-0.9.21-10.1.1.x86_64
libpulse0-0.9.21-10.1.1.x86_64

I just have to say it. I, and people I've installed Linux for, have had way too many problems with pulseaudio. This is why I'm starting to ditch GNOME in favor of KDE. At least with KDE, you can have pulseaudio completely disabled, but not lose your shortcut keys, your volume controls, or your audio settings. Sorry to hear about your issue, Hans-Robert.

But back to the bug. Hope there's a way to plug the memory leak without resorting to disabling pulseaudio or removing it from a GNOME setup.

Revision history for this message
In , flan_suse (flansuse) wrote :

I re-installed the pulseaudio package, then disabled PulseAudio with YaST. But polkitd still has a memory leak.

Revision history for this message
Supertech1 (temp-techsoftadvanced) wrote :

I am experiencing this issue in Fedora 14 on a relatively clean install with few--if any--"advanced" changes, so it is certainly not unique to Ubuntu.

Revision history for this message
Supertech1 (temp-techsoftadvanced) wrote :

Perhaps this is helpful, as well: it's not anything new that I installed. Whatever it is, it was triggered either by an update to an existing package around late December/early January from the default Fedora RPM repositories. Perhaps by cross-checking that with APT, we can determine which package/version introduced the bug.

Revision history for this message
dinexi (im-dinexi) wrote :

I have the same issue in Ubuntu 10.10 (amd64 and i386). policykit-1 version is 0.96-2ubuntu1. And I need to say that this bug is not related to pulseaudio in anyway. I have set autospawn to no, killed the pulseaudio instance and ps tells me that there is no pulseaudio running. So I am agree with #9: pulseaudio is not the root of evil. Polkitd eats a lot of memory each time it is checking /var/lib/polkit-1/localauthority/ and /etc/polkit-1/localauthority/. Now it runs for 5 minutes and eats 0.2% of CPU and 0.5% of memory.
I've added the strace output.

Revision history for this message
Psychotron (redm) wrote :

I'm just investigating this annoying problem again. So seems I have a mem leaking polkitd, too. Seems it has something to do with the bug I reported under Bug #704055. After every CPU spike it uses some 300KB more.

Btw, why is such a problem only marked Medium??

This is on 10.10.

Revision history for this message
dinexi (im-dinexi) wrote :

Psychotron, don't you have some user who logins to your computer using SSH? In my case, the problem was in such logins.

Revision history for this message
dinexi (im-dinexi) wrote :

More than that. In Maverick amd64 the option UsePAM yes makes polkitd grow drastically in time of each login.
With UsePAM yes:
[stanis@dinexi ~] % tail -n 1 /etc/ssh/sshd_config
UsePAM yes
[stanis@dinexi ~] % ps aux | grep polkitd | grep -v grep
root 1698 0.0 0.6 62904 12744 ? S Mar13 0:10 /usr/lib/policykit-1/polkitd
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ps aux | grep polkitd | grep -v grep
root 1698 0.0 0.6 64488 14252 ? S Mar13 0:12 /usr/lib/policykit-1/polkitd
Changing this option to 'no' and restarting ssh service:
[stanis@dinexi ~] % tail -n 1 /etc/ssh/sshd_config
UsePAM no
[stanis@dinexi ~] % sudo service ssh restart
ssh start/running, process 29226
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ssh -p 422 dinexi -C 'exit'
[stanis@dinexi ~] % ps aux | grep polkitd | grep -v grep
root 1698 0.0 0.6 64488 14252 ? S Mar13 0:12 /usr/lib/policykit-1/polkitd

Revision history for this message
In , Kasievers (kasievers) wrote :

I was never really able to reproduce the issue. And only a very few boxes seem to have this issue. I really have no idea what's going on here.

Somebody who can trigger this, any chance to try the version from Base:System, which has a bunch of fixes?

Revision history for this message
Jan Prach (jendap) wrote :

I've rebuild the polycikitd-1 package with debug info and run valgrind's memcheck on it. After approximately three minutes I've killed it.

Memcheck points out polkit_backend_local_authorization_store_lookup method!

Strace tells it keeps on reading everything from /var/lib/polkit-1/localauthority/ again and again.

Revision history for this message
dinexi (im-dinexi) wrote :

Yes, it is. But in my case the check was invoked at every time of SSH connect to my comp.

Revision history for this message
In , Swamp-a (swamp-a) wrote :

Update released for: libpolkit0, libpolkit0-debuginfo, polkit, polkit-debuginfo, polkit-debugsource, polkit-devel, polkit-devel-debuginfo, polkit-doc
Products:
openSUSE 11.4 (debug, i586, x86_64)

Revision history for this message
In , Kasievers (kasievers) wrote :

Closing.

Revision history for this message
The Big Monkey (wipmonkey) wrote :

Any workaround or fix? I'm running 10.04 and the memory is running away.

Changed in policykit-1 (openSUSE):
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
dino99 (9d9) wrote :

declared as fixed

Changed in policykit-1:
importance: Unknown → Undecided
status: Unknown → New
status: New → Fix Released
Changed in policykit-1 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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