[Pm-utils] upower/pm-utils deadlock when pm-suspend called by upowerd
vuntz at gnome.org
Tue Jun 22 03:54:33 PDT 2010
(I'm not subscribed, please cc me if you need input from me :-))
There's a nice deadlock when pm-suspend is called by upowerd:
+ upowerd calls pm-suspend with g_spawn_sync(). That's because it wants
to know if the call failed to return an error via dbus if needed.
+ pm-suspend suspends, everything is happy. Then it resumes.
+ the /usr/lib/pm-utils/sleep.d/00powersave hook calls pm-powersave
with no argument
+ pm-powersave needs to know if the computer is on battery or not. So
it calls on_ac_power.
+ on_ac_power knows that upower is cool, so it asks upower via dbus if
the computer is on battery... except that upowerd is still blocked in
The results of this is that the calling process is blocked for some time
(a dbus timeout), which can result in ugly ghost windows. See
https://bugzilla.novell.com/show_bug.cgi?id=615646 for example.
Richard is thinking that the pm-powersave part might be better handled
by upowerd itself instead of a hook for pm-suspend...
Les gens heureux ne sont pas pressés.
More information about the Pm-utils