gnome-keyring-daemon leaks memory

Bug #1094496 reported by Brian J. Murrell
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GNOME Keyring
Fix Released
Medium
gnome-keyring (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

* Impact:
gnome-keyring leaks memory which is not nice

* Test Case:
run a GNOME or Unity session for some time, watch the gnome-keyring-daemon memory usage

* Regression Potential:
check that keyring keeps working fine (ssh/ggp agents, network-manager passwords, etc)

-----------

gnome-keyring-daemon gets killed here every few days due to it's memory size exceeding the site imposed limit of 2GB per process. The ulimit of course is not the problem as even with an unlimited setting, it would just grow until it was killed by the OOM killer.

The real problem here is that gnome-keyring-daemon has no business growing to even a fraction of the 2GB limit imposed here. 2G for a simple keyring daemon is absurd.

Looking at the upstream changelog for versions beyond the 3.2.2 on which the Ubuntu version is based appear to have fixed memory leaks. Given that this leaking 3.2.2-2ubuntu4 version is in the Precise LTS release, upgrading to a newer Ubuntu release is not a solution nor an option -- this LTS release is supposed to be supported beyond 2017. A fix needs to be backported. Having gnome-keyring-daemon leaking for 5 more years is simply unacceptable.

ProblemType: Bug
DistroRelease: LinuxMint 12
Package: gnome-keyring 3.2.2-2ubuntu4
ProcVersionSignature: Ubuntu 3.2.0-29.46-generic-pae 3.2.24
Uname: Linux 3.2.0-29-generic-pae i686
ApportVersion: 2.0.1-0ubuntu15
Architecture: i386
Date: Sat Dec 29 11:38:45 2012
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-keyring
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.xdg.autostart.gnome.keyring.gpg.desktop: [modified]
modified.conffile..etc.xdg.autostart.gnome.keyring.pkcs11.desktop: [modified]
modified.conffile..etc.xdg.autostart.gnome.keyring.secrets.desktop: [modified]
modified.conffile..etc.xdg.autostart.gnome.keyring.ssh.desktop: [modified]
mtime.conffile..etc.xdg.autostart.gnome.keyring.gpg.desktop: 2012-03-21T15:31:45
mtime.conffile..etc.xdg.autostart.gnome.keyring.pkcs11.desktop: 2012-02-23T18:28:50
mtime.conffile..etc.xdg.autostart.gnome.keyring.secrets.desktop: 2012-02-23T18:26:38
mtime.conffile..etc.xdg.autostart.gnome.keyring.ssh.desktop: 2012-03-21T15:32:22

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :
Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

This patch from upstream bug #684351 seems to fix the problem here for me.

Changed in gnome-keyring:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch to fix memory leak" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Brian, do you have details on how to trigger the leak? It's not happening to every user and to reach that usage you probably have a client doing lot of keyring calls? I wonder if we could get a testcase and a improve the testsuit once the bug fixed to make sure the issue doesn't come back in such scenarios

Upstream wrote on bugzilla that "The leak is not cumulative" so it's a bit weird that it would lead to this situation, in any case since the fix seems right and works for you we can SRU it to precise, I would like to have a reply about some of those details first if possible though

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote : Re: [Bug 1094496] Re: gnome-keyring-daemon leaks memory

On 13-01-07 01:06 PM, Sebastien Bacher wrote:
> Thanks Brian, do you have details on how to trigger the leak?

Nothing more specific than just "sit back and wait". :-) Seriously, I
don't to anything special here. I keep SSH and PGP keys in my keyring
and ssh a lot and sign every outgoing e-mail. Both ssh and e-mail
signing utilize the keyring of course.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

The patch is applied in gnome-keyring >= 3.6.1, so marking as Fix Released. If you want to get this applied in previous releases, please follow instructions at <https://wiki.ubuntu.com/StableReleaseUpdates#Procedure>.

Changed in gnome-keyring (Ubuntu):
status: New → Fix Released
Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

On 13-03-08 08:08 AM, Dmitry Shachnev wrote:
> The patch is applied in gnome-keyring >= 3.6.1,

Will that release go into the current LTS, 12.04? LTS is Long Term
Support so I would expect it to see bug fixes without requiring
individuals to file specific requests to have a bug fixed in it.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I don't have a 12.04 machine to build/test the fix on, maybe someone else can do that.

Or you can apply the patch yourself and submit a merge proposal against lp:ubuntu/precise/gnome-keyring, so that it'll show up in the sponsorship queue. See <http://developer.ubuntu.com/packaging/html/fixing-a-bug.html> for details.

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

But I do have a 12.04 machine and I already submitted a patch (which just came from upstream, not my patch) which fixes the problem on the gnome-keyring shipped in 12.04 LTS. So really, I don't know why you are proposing all of this rigmarole with backporting patches from g-k-r 3.6.1 and sponsorship, etc. Why not just ship the LTS 3.2.2 g-k-r release with the attached patch?

It's all of this beauraucratic red-tape to getting such a simple but important fix into what is supposed to be a supported release that makes Ubuntu no longer a desired platform to use.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> It's all of this beauraucratic red-tape to getting such a simple but important fix into what is supposed to be a supported release that makes Ubuntu no longer a desired platform to use.

oh come on, what "all of this beauraucratic red-tape", bugs just need basic infos on
- impact (what's the issue)
- test case (so the fix can be confirmed)
- regression potential (so testers know if they should watch for a potentiel regression)

it's basic infos that takes a few minutes to write (if you don't need to write a program as testcase)

then you need somebody to do the upload, anyone is welcome to help and provide a debdiff to help on that rather than complaining that volunteers don't work enough or not in a reasonable timeline fashion

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Brian: I will SRU that fix, I've marked it on my todolist for a while, but there is only so many hours in a week and only so many developers to maintain some thousands packages accross several release of Ubuntu, such comments don't make me feel motivated to do the work though :-(

Changed in gnome-keyring (Ubuntu):
importance: Undecided → High
Changed in gnome-keyring (Ubuntu Precise):
importance: Undecided → High
status: New → In Progress
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted gnome-keyring into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/gnome-keyring/3.2.2-2ubuntu4.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 gnome-keyring (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote :

Brian, can you confirm that the SRUed version fixes the problem for you? We need some confirmation of the bugfix before it can be published to precise-updates.

As Seb pointed out earlier, this problem is not reproducible for all users. By that measure, the test case in the bug description is incomplete, because it does not tell users how to reproduce the problem.

Revision history for this message
Hein Zelle (hein) wrote : Re: [Bug 1094496] Re: gnome-keyring-daemon leaks memory

Dear Steve Langasek,

> Brian, can you confirm that the SRUed version fixes the problem for you?
> We need some confirmation of the bugfix before it can be published to
> precise-updates.
>
> As Seb pointed out earlier, this problem is not reproducible for all
> users. By that measure, the test case in the bug description is
> incomplete, because it does not tell users how to reproduce the problem.

I have installed the SRUed version at home (at least, I think I did it
correctly):

ii gnome-keyring 3.2.2-2ubuntu4 GNOME keyring services (daemon and tools)

It is running normally and not causing any problems at this moment.
Memory usage seems relatively normal:

hein 1899 0.0 0.0 368880 3732 ? Sl 21:01 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login

although the virtual use does seem high but I see that with a lot of
programs on 64 bit ubuntu. I will try it out at work where I actually
noticed the memory leak and confirm again once I see it running a bit
longer.

Kind regards,
     Hein

--

 Hein Zelle <email address hidden>
                         http://www.icce.rug.nl/~hein

Revision history for this message
Steve Langasek (vorlon) wrote :

Hein, have you had a chance to test this at work?

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Hello Hein,

Were you able to test this in your reproducable environment yet?

Thanks!
Adam

Revision history for this message
Hein Zelle (hein) wrote :

I've finally been able to test the new version on both my home machine and the work machine that originally showed the problem. Results seem positive: memory usage appears normal and doesn't grow after a full day of running.

directly after starting:

> zelle 24481 0.1 0.0 216800 4304 ? SLl 15:54 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login

30 minutes and some use later:

> zelle 24481 0.0 0.0 364264 4432 ? SLl 15:54 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login

The next day (approx. 24 hours):

> zelle 24481 0.0 0.0 437996 4104 ? SLl May01 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login

There doesn't appear to be a memory leak, however the virtual memory allocation shown by ps is still significant with 440 Mb. I see this with lots of programs on 64 bit ubuntu, though, so that may be another problem altogether.

Note that I have disabled some of the xdg services in the mean time, which may prevent me from seeing the problem return. I've disabled the following services (XFCE, located in ~/.config/autostart):

> gnome-keyring-gpg.desktop
> gnome-keyring-secrets.desktop
> gnome-keyring-pkcs11.desktop
> gnome-keyring-ssh.desktop

Instead, I now only start gnome-keyring once with the following options:

> gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg

I'm not sure if this is relevant for the bug(fix), but with that last commandline everything seems to work fine now.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update 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 regresssions.

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

This bug was fixed in the package gnome-keyring - 3.2.2-2ubuntu4.1

---------------
gnome-keyring (3.2.2-2ubuntu4.1) precise; urgency=low

  * debian/patches/git_leak_fix.patch: "rpc-layer: Fix memory leak in call
    state pool", thanks Brian J. Murrell for pointing it (lp: #1094496)
 -- Sebastien Bacher <email address hidden> Fri, 08 Mar 2013 17:04:41 +0100

Changed in gnome-keyring (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
wyderkat (wyderka-t) wrote :

Another way to reproduce that bug:

ssh-keygen -t rsa -N "" -f ~/.ssh/newkey
ssh-copy-id -i ~/.ssh/newkey.pub localhost
while true; do ssh localhost date; done

Then sit and observe in another terminal how memory disappears.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

@wyderkat: which gnome-keyring version is that? There were *lots* of leak fixes in 3.16 release.

Revision history for this message
fabioxxxx (fabioxxxx) wrote :

Tested with chrome making the login on X website with my credentials saved, gnome-keyring memory rose , logout and login on the same X website keyring memory rose again... by the end of the week gnome-keyring is using almost 200mb : O
(a lot of sites and ecomerce have timed logins so it happens a lot )

will the fix get to ubuntu 14.04 ?

UBUNTU 14.04.03 3.13.0-67-generic
google-chrome-stable 46.0.2490.80-1
gnome-keyring 3.10.1-1ubuntu4.2
Xfce 4.12

thanks.

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.