[Bug 232557]

Anders Kaseorg andersk at mit.edu
Thu Jan 19 22:25:52 UTC 2012


(In reply to comment #14)
> Please either apply the patch, or find some other way to stop the leak.

William already applied a modified version of my patch for 0.4.2.  The leak should already be gone.
http://cgit.freedesktop.org/ConsoleKit/commit/?id=7b9212fa6aff55420c58f2cacd0a941762920337

In the discussion that followed, I was just worried that his
modifications introduced a potential use-after-free crash, because the
JobData created by ck_session_leader_collect_parameters isn’t holding a
reference to its leader.  If there is no way for a CkSessionLeader to be
freed with entries remaining in its pending_jobs queue (previously this
was prevented by the missing unref in create_session_for_sender), then
that isn’t a concern and this can be closed.  Otherwise, perhaps this
presentation makes it clearer why the extra ref and unref are okay?

--- a/src/ck-session-leader.c
+++ b/src/ck-session-leader.c
@@ -409,6 +409,7 @@ job_completed (CkJob     *job,
 static void
 job_data_free (JobData *data)
 {
+        g_object_unref (data->leader);
         g_free (data);
 }
 
@@ -428,7 +429,7 @@ ck_session_leader_collect_parameters (CkSessionLeader        *session_leader,
         ret = FALSE;
 
         data = g_new0 (JobData, 1);
-        data->leader = session_leader;
+        data->leader = g_object_ref (session_leader);
         data->done_cb = done_cb;
         data->user_data = user_data;
         data->context = context;

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to consolekit in Ubuntu.
https://bugs.launchpad.net/bugs/232557

Title:
  console-kit-daemon leaks memory

Status in ConsoleKit:
  Confirmed
Status in “consolekit” package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: consolekit

  After 23 days of uptime, the console-kit-daemon process is using up
  168M of memory:

  root      5462  0.0  8.3 213208 172740 ?       Ssl  Apr28   3:53
  /usr/sbin/console-kit-daemon

  ProblemType: Bug
  Architecture: i386
  Date: Wed May 21 12:09:35 2008
  DistroRelease: Ubuntu 8.04
  ExecutablePath: /usr/sbin/console-kit-daemon
  NonfreeKernelModules: nvidia
  Package: consolekit 0.2.3-3ubuntu5
  PackageArchitecture: i386
  ProcEnviron:
   
  SourcePackage: consolekit
  Uname: Linux 2.6.24-16-generic i686

To manage notifications about this bug go to:
https://bugs.launchpad.net/consolekit/+bug/232557/+subscriptions




More information about the foundations-bugs mailing list