Kdeinit4 is leaking memory on every ssh login due to known bug on policykit-1

Bug #1417637 reported by Luis Lucas
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PolicyKit
Fix Released
High
policykit-1 (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
Undecided
Unassigned
Utopic
Fix Released
Undecided
Unassigned
Vivid
Fix Released
Undecided
Unassigned

Bug Description

A memory leak in policykit causes memory exhaustion over time in kdeinit4.

[Test Case]
1- check memory usage of kdeinit4 under htop (RES column)
2- ssh in
3- check to make sure it stays constant

[Regression Potential]
If the patch is incorrect, policykit could possibly crash.

Every time ssh login is made on ubuntu 14.04, kdeinit4 leaks 2-3 Mb (when kde is installed).
According to previous bug report in: https://bugs.kde.org/show_bug.cgi?id=271934
this is a bug in policykit-1 package, and it has been already fixed on upstream.
Update of policykit-1 should fix this problem on kubuntu 14.04 and Ubuntu 14.04 + Kde.

This bug is severe in some specific scenarios where ssh is often used.
In my case, I have a lot of scripts running processes every hour between ubuntu and kubuntu machines using passwordless ssh login. In few days kubuntu machines don't have free memory, due to the referred leak.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: policykit-1 0.105-4ubuntu2
ProcVersionSignature: Ubuntu 3.13.0-43.72-generic 3.13.11.11
Uname: Linux 3.13.0-43-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.6
Architecture: amd64
CurrentDesktop: KDE
Date: Tue Feb 3 15:33:04 2015
InstallationDate: Installed on 2013-09-26 (494 days ago)
InstallationMedia: Kubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130902.2)
SourcePackage: policykit-1
UpgradeStatus: Upgraded to trusty on 2014-04-14 (294 days ago)

Revision history for this message
In , Dednev (dednev) wrote :

Created attachment 112087
Fix for memory leak in EnumerateActions call results handler.

I've found, that policykit-1-0.105 in my Debian Wheezy doesn't release reference counters of GVariant data for org.freedesktop.PolicyKit1.Authority.EnumerateActions DBUS call resulting data.

See patch in attachment.
g_variant_ref_sink (child) call was odd in case of iterating array child items.

Revision history for this message
In , Dednev (dednev) wrote :

There is high possibility that this bug causes memory leaking in kded4 (see https://bugs.kde.org/show_bug.cgi?id=271934) and other policykit-1 client software.

Revision history for this message
In , Colin Walters (walters) wrote :

Looks good to me, thanks! I tweaked the commit message to match the standard style, and pushed.

Revision history for this message
Luis Lucas (lfrlucas) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in policykit-1 (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This appears to be the fix, unreleased upstream yet, thus probably affects all current series.

http://cgit.freedesktop.org/polkit/commit/?id=f4d71e0de885010494b8b0b8d62ca910011d7544

Revision history for this message
Luis Lucas (lfrlucas) wrote :

I applied this patch: http://cgit.freedesktop.org/polkit/patch/?id=f4d71e0de885010494b8b0b8d62ca910011d7544 on policykit-1.
I check memory usage of kdeinit4 under htop (RES column), ssh in, check again it stays constant now.

Changed in policykit-1:
importance: Unknown → High
status: Unknown → Fix Released
Revision history for this message
Luis Lucas (lfrlucas) wrote :

debdiff for the bug fix is in attachment

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

By large the above debdiff should be (with correct version number and target) should be applied and uploaded into vivid, utopic and trusty.

Series targets opened & ubuntu-sponsors subscribed to the bug report.

Test case description for SRUs is in https://bugs.launchpad.net/ubuntu/+source/policykit-1/+bug/1417637/comments/4

Changed in policykit-1 (Ubuntu Trusty):
status: New → Confirmed
Changed in policykit-1 (Ubuntu Utopic):
status: New → Confirmed
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

ACK on the debdiff.

I've uploaded to vivid.
I've uploaded to trusty and utopic for processing by the SRU team.

Thanks!

description: updated
Changed in policykit-1 (Ubuntu Vivid):
status: Confirmed → Fix Committed
Changed in policykit-1 (Ubuntu Trusty):
status: Confirmed → In Progress
Changed in policykit-1 (Ubuntu Utopic):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package policykit-1 - 0.105-8ubuntu2

---------------
policykit-1 (0.105-8ubuntu2) vivid; urgency=medium

  * debian/patches/fix_memleak.patch:
    authority: Fix memory leak in EnumerateActions call results handler
    (lp: #1417637)
 -- Luis Lucas <email address hidden> Tue, 03 Feb 2015 17:15:02 +0000

Changed in policykit-1 (Ubuntu Vivid):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Luis, or anyone else affected,

Accepted policykit-1 into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/policykit-1/0.105-4ubuntu2.14.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in policykit-1 (Ubuntu Utopic):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in policykit-1 (Ubuntu Trusty):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Luis, or anyone else affected,

Accepted policykit-1 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/policykit-1/0.105-4ubuntu2.14.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Luis Lucas (lfrlucas) wrote : Re: [Bug 1417637] Re: Kdeinit4 is leaking memory on every ssh login due to known bug on policykit-1
Download full text (3.7 KiB)

Hello,

I added trusty-proposed source to my ubuntu 14.04 system and I installed
the new policykit-1 packaged. I reproduced the bug and it isn't solved.
Am I missing something in the verification process?

Best regards
Luis Lucas

2015-03-04 22:40 GMT+00:00 Brian Murray <email address hidden>:

> Hello Luis, or anyone else affected,
>
> Accepted policykit-1 into utopic-proposed. The package will build now
> and be available at
> https://launchpad.net/ubuntu/+source/policykit-1/0.105-4ubuntu2.14.10.1
> in a few hours, and then in the -proposed repository.
>
> Please help us by testing this new package. See
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
> enable and use -proposed. Your feedback will aid us getting this update
> out to other Ubuntu users.
>
> If this package fixes the bug for you, please add a comment to this bug,
> mentioning the version of the package you tested, and change the tag
> from verification-needed to verification-done. If it does not fix the
> bug for you, please add a comment stating that, and change the tag to
> verification-failed. In either case, details of your testing will help
> us make a better decision.
>
> Further information regarding the verification process can be found at
> https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
> advance!
>
> ** Changed in: policykit-1 (Ubuntu Utopic)
> Status: In Progress => Fix Committed
>
> ** Tags added: verification-needed
>
> ** Changed in: policykit-1 (Ubuntu Trusty)
> Status: In Progress => Fix Committed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1417637
>
> Title:
> Kdeinit4 is leaking memory on every ssh login due to known bug on
> policykit-1
>
> Status in System policy:
> Fix Released
> Status in policykit-1 package in Ubuntu:
> Fix Released
> Status in policykit-1 source package in Trusty:
> Fix Committed
> Status in policykit-1 source package in Utopic:
> Fix Committed
> Status in policykit-1 source package in Vivid:
> Fix Released
>
> Bug description:
> A memory leak in policykit causes memory exhaustion over time in
> kdeinit4.
>
> [Test Case]
> 1- check memory usage of kdeinit4 under htop (RES column)
> 2- ssh in
> 3- check to make sure it stays constant
>
> [Regression Potential]
> If the patch is incorrect, policykit could possibly crash.
>
>
> Every time ssh login is made on ubuntu 14.04, kdeinit4 leaks 2-3 Mb
> (when kde is installed).
> According to previous bug report in:
> https://bugs.kde.org/show_bug.cgi?id=271934
> this is a bug in policykit-1 package, and it has been already fixed on
> upstream.
> Update of policykit-1 should fix this problem on kubuntu 14.04 and
> Ubuntu 14.04 + Kde.
>
> This bug is severe in some specific scenarios where ssh is often used.
> In my case, I have a lot of scripts running processes every hour between
> ubuntu and kubuntu machines using passwordless ssh login. In few days
> kubuntu machines don't have free memory, due to the referred leak.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 14.04
> Package: policykit-1 0.105-4ub...

Read more...

Revision history for this message
Luis Lucas (lfrlucas) wrote :

I installed polkicykit-1 and libpolkit dependencies from trusty proposed ppa (version 0.105-4ubuntu2.14.04.1) in my 14.04 ubuntu system.
I tried to reproduce the bug and it was gone.
Thank you for accepting this bug fix!

tags: added: verification-done
removed: verification-needed
tags: added: verification-done-trusty verification-needed
removed: verification-done
Mathew Hodson (mhodson)
tags: added: verification-needed-utopic
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package policykit-1 - 0.105-4ubuntu2.14.04.1

---------------
policykit-1 (0.105-4ubuntu2.14.04.1) trusty; urgency=medium

  * debian/patches/fix_memleak.patch:
    authority: Fix memory leak in EnumerateActions call results handler
    (lp: #1417637)
 -- Luis Lucas <email address hidden> Tue, 03 Feb 2015 17:15:02 +0000

Changed in policykit-1 (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for policykit-1 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package policykit-1 - 0.105-4ubuntu2.14.10.1

---------------
policykit-1 (0.105-4ubuntu2.14.10.1) utopic; urgency=medium

  * debian/patches/fix_memleak.patch:
    authority: Fix memory leak in EnumerateActions call results handler
    (lp: #1417637)
 -- Luis Lucas <email address hidden> Tue, 03 Feb 2015 17:15:02 +0000

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

Other bug subscribers

Remote bug watches

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