GNOME Bugzilla – Bug 598221
GPM crashes when plugging in/out AC
Last modified: 2009-10-14 08:02:15 UTC
Originally reported: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/447304 Summary: "[I] was moving the computer and puled out the power cable and when I sit down the power manager informed me that it had crashed." Launchpad has received at least one duplicate, and it seems to be repeatable. Stack trace:
+ Trace 218257
gnome-power-bugreport.sh output is here: http://launchpadlibrarian.net/33387185/gnome-power-bugreport.txt
This looks like a problem in dbus-glib: /* set spindown timeouts */ ret = dbus_g_proxy_call (disks->priv->proxy, "DriveSetAllSpindownTimeouts", &error, G_TYPE_INT, timeout, G_TYPE_STRV, options, G_TYPE_INVALID, G_TYPE_STRING, disks->priv->cookie, G_TYPE_INVALID); if (!ret) { egg_warning ("failed to set spindown timeout: %s", error->message); ^- GOES BANG g_error_free (error); goto out; } But in the docs: dbus_g_proxy_call()... Returns : FALSE if an error is set, TRUE otherwise. So it's returning FALSE without setting ERROR non-NULL.
Thanks for looking at this, Richard. I found this, and think we're on to something: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541632 "By passing dbus_g_proxy_call an incorrect signature, we can cause the function to fail but not provide any error message. This isn't helpful. This patch causes it to set an error when demarshalling a type that it's not expecting. Instead of a NULL error, one instead sees something like the following when the method returns a path object but the client expected a string:" I think we're passing "timeout" as a guint when it is expecting a gint according to its signature. I made a patch for it and am testing it at: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/447304 Does that make sense? I'll attach the patch next.
Created attachment 145359 [details] [review] Debian quilt-style patch to fix crash on AC plug in Here's the patch that should make "timeout" an int instead of uint.
(In reply to comment #4) > Created an attachment (id=145359) [details] > Debian quilt-style patch to fix crash on AC plug in Applied, thanks!