GNOME Bugzilla – Bug 683533
[PATCH] Crash in got_power_proxy_cb()
Last modified: 2012-09-10 18:26:00 UTC
Hello! This is an Ubuntu bug that seems to also be a GNOME bug. Downstream bug: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/929378 Stacktrace: https://launchpadlibrarian.net/92392207/Stacktrace.txt In cc-power-panel.c, there is a cancellable object passed to various dbus operations calls. But it isn't used well: 1) It is cancelled in finalize, after dispose has already NULL'd the pointer out. So it never actually gets to cancel anything. 2) When cancelled, the callbacks registered with the cancellable object don't properly handle the case of the panel object being disposed and thus may attempt to set/access freed memory. Here's a patch that attempts to fix both those issues.
Created attachment 223701 [details] [review] Proposed patch
Review of attachment 223701 [details] [review]: Otherwise looks good to apply to both gnome-3-4 and master. ::: panels/power/cc-power-panel.c @@ +653,3 @@ + { + g_error_free (error); + return; // Must exit before accessing freed memory No C++ style comments please.
Done. [master] commit 5f353fa2b6d44a4be4e601b25f712e73736cd4c2 Author: Michael Terry <michael.terry@canonical.com> Date: Fri Sep 7 15:37:42 2012 -0400 power: Use GCancellable better, to avoid a crash https://bugzilla.gnome.org/show_bug.cgi?id=683533 [gnome-3.4] commit 1801b2f4648b3e89b11cde7023c0046a98a0f1f1 Author: Michael Terry <michael.terry@canonical.com> Date: Mon Sep 10 14:24:12 2012 -0400 power: Use GCancellable better, to avoid a crash https://bugzilla.gnome.org/show_bug.cgi?id=683533