[karmic] devicekit-power broken by 008-1 to 008-1ubuntu1 update

Bug #392798 reported by Roland Dreier
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
devicekit-power (Ubuntu)
Fix Released
Critical
Martin Pitt

Bug Description

Binary package hint: devicekit-power

After the update in karmic of devicekit-power from 008-1 to 008-1ubuntu1, the devkit-power daemon does not seem to get started. The symptoms are that gnome-power-manager no longer knows I have a battery (it just shows the "plug" icon no matter what my laptop's state is, rather than correctly showing the battery charge and AC adapter state as before). Also, from the command line, I get:

  $ devkit-power

  (devkit-power:6225): devkit-power-gobject-WARNING **: Couldn't enumerate devices: Message did not receive a reply (timeout by message bus)

and

  $ ps ax|grep -e 'dev.*pow'
   6241 pts/0 S+ 0:00 grep -e dev.*pow

(Ie no daemon gets activated by dbus).

AFAICT, the only change from 008-1 to 008-1ubuntu1 was the addition of the pm-powersave.patch, which (aside from the fact that the command returned from g_strdup_printf() is not freed in dkp_daemon_set_pmutils_powersave() and hence leaked) looks fairly harmless to me. So I'm not sure what the real issue is, but something definitely is wrong, since downgrading devicekit-power back to 008-1 definitely fixes things for me.

ProblemType: Bug
Architecture: amd64
Date: Fri Jun 26 22:55:45 2009
DistroRelease: Ubuntu 9.10
Package: devicekit-power 008-1ubuntu1
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-1.13-generic
SourcePackage: devicekit-power
Uname: Linux 2.6.31-1-generic x86_64

Revision history for this message
Roland Dreier (roland.dreier) wrote :
Revision history for this message
Timothy Palpant (timothypalpant) wrote :

I can confirm this bug, as well as the fact that reverting to 008-1 fixes the problem.

Changed in devicekit-power (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert Hooker (sarvatt) wrote :

Also having this problem here, mentioned it in the duped bug here --

https://bugs.edge.launchpad.net/bugs/392906

reverting devicekit-power also fixes it for me. It seems like the pm-powersave commit that was added as a patch might be reliant on other commits post 008 to work right because it functions properly building from git master, but not when only that commit is added as in 0ubuntu1.

Revision history for this message
Robert Hooker (sarvatt) wrote :

I have uploaded the current git master of devicekit-power to this PPA incase it helps anyone, and attached a debdiff against 008-1ubuntu1. It works for me where 008-1ubuntu1 did not on any of the 4 machines I installed it on. Desktop systems don't notice the bug as prominently because the default action for gnome-power-manager is to hide the icon unless charging, but if you change it to always show (or alternately run gnome-power-manager from a terminal to see the messages) you can see that it stops working.

https://edge.launchpad.net/~sarvatt/+archive/more-bugs

Revision history for this message
christoph sturm (christoph-sturm) wrote :

the ppa package doesnt fix it for me

$ devkit-power -d

(devkit-power:6054): devkit-power-gobject-WARNING **: Couldn't enumerate devices: Message did not receive a reply (timeout by message bus)
Daemon:

(devkit-power:6054): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
  daemon-version: (null)

(devkit-power:6054): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
  can-suspend: no

(devkit-power:6054): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
  can-hibernate no

(devkit-power:6054): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
  on-battery: no

(devkit-power:6054): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
  on-low-battery: no

(devkit-power:6054): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
  lid-is-closed: no

Revision history for this message
Robert Hooker (sarvatt) wrote :

Have you rebooted after installing it? Looks like it didnt update yet because it was still in use by something (like gnome-power-manager), daemon-version returns 8 here on every machine and not null. Killing gnome-power-manager and restarting it should work, I didn't have it running when I upgraded and didn't need to reboot.

Revision history for this message
christoph sturm (christoph-sturm) wrote :

yeah, i rebooted after installing.
any logfile i could check?

Revision history for this message
christoph sturm (christoph-sturm) wrote :

here's devkit-power -v in case that helps:
TI:21:00:40 TH:0x148dc90 FI:egg-debug.c FN:egg_debug_init,306
 - Verbose debugging 1 (on console 1)DKP_VERBOSE

(devkit-power:5308): devkit-power-gobject-WARNING **: Couldn't enumerate devices: Message did not receive a reply (timeout by message bus)

(devkit-power:5308): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Message did not receive a reply (timeout by message bus)
DeviceKit-power client version 009
DeviceKit-power daemon version (null)

Revision history for this message
Roland Dreier (roland.dreier) wrote :

I debugged most of the problem here; it is indeed coming from the pm-powersave patch, and there are a couple of related problems. First, the patch adds a call to g_spawn_command_line_async() to run "pm-powersave," and when the devkit-power daemon is started by the dbus system bus, that call is failing -- most likely because the daemon process is started with an empty PATH and so it can't find the pm-powersave executable. I didn't try to fix that problem.

The second issue is that the pm-powersave patch's error handling is buggy -- it passes an uninitialized g_error pointer into g_spawn_command_line_async(), so when an error occurs, glib doesn't overwrite that uninitialized value with the real error, and the daemon ends up calling g_error_free() on a garbage pointer and crashing. I'm attaching a patch (also sent to the devkit-devel and devkit-power maintainer) that fixes that error handling.

I built a package with that patch applied on top of the pm-powersave patch and with that fix things work as expected; of course the pm-powersave patch isn't doing anything except failing to exec "pm-powersave" so there's not much point to this approach rather than just reverting back to the old 008-1 package.

Revision history for this message
Roland Dreier (roland.dreier) wrote :

By the way, I'm also attaching another patch that fixes a memory leak in the pm-powersave patch (also sent upstream) that fixes a memory leak in the pm-powersave patch; the leak is likely very slow so it wouldn't hurt for a long time, but anyway here it is...

Revision history for this message
Robert Hooker (sarvatt) wrote :

Ahh yeah the git snapshot wasnt helping anything, it turned out I had the old daemon loaded from the 008-1 package on every machine which explained why devkit-power was returning version 9 but the daemon version 8. I'm sorry for the noise.

Revision history for this message
Martin Pitt (pitti) wrote :

Sorry about that. I fixed it on Saturday night, but I was offline and thus not reading bugs:

devicekit-power (008-1ubuntu2) karmic; urgency=low

  * Add 02_pm-powersave-fix.patch: Fix calling of pm-powersave so that it
    actually works when running through D-Bus activated dk-p, and avoid a
    segfault and memory leak.

 -- Martin Pitt <email address hidden> Sat, 27 Jun 2009 19:24:47 +0200

Changed in devicekit-power (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Critical
status: Confirmed → Fix Released
Revision history for this message
David Leal (dgleal) wrote :

I'm still experiencing this problem. However my architecture is i386. Anything I can do to help debug this?

Thanks.

Revision history for this message
Tristan Tarrant (tristan-tarrant-gmail) wrote :

I am having the same problem on my notebook, and it seems to be kernel version related.
In particular with linux-image 2.6.31-3 it works, but with all kernels since then, up to the current linux-image 2.6.31-6 devkit-power does not work.

What can I do to log/debug the problem ?

Here are my versions (up-to-date Karmic):

linux-image: 2.6.31-6.25
devicekit-power: 010-0ubuntu1

Running devkit-power-d produces the following output:

devkit-power -d

(devkit-power:5253): devkit-power-gobject-WARNING **: Couldn't enumerate devices: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Daemon:

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(devkit-power:5253): devkit-power-gobject-WARNING **: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
  daemon-version: (null)
  can-suspend: no
  can-hibernate no
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: no

Revision history for this message
Martin Pitt (pitti) wrote :

Tristan, looks like the daemon is crashing for you. Please open a new bug report and do

  sudo killall devkit-power-daemon
  sudo /usr/lib/devicekit-power/devkit-power-daemon 2>&1 | tee /tmp/dkp.log

Does that terminate on its own? If not, press control-C after some seconds. Please attach /tmp/dkp.log to the new bug.

Revision history for this message
Tristan Tarrant (tristan-tarrant-gmail) wrote :

Hi Martin,

I could not even kill the devkit-power-daemon process (not even with -9). With Kernel -8 (and the subsequent -9) the problem has gone away so I'm happy at the moment-

Revision history for this message
urho (vonturha) wrote :
Download full text (3.2 KiB)

i get following messages in my sys.log:

mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'IsPresent'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'RecallNotice'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Percentage'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'RecallVendor'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'RecallUrl'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'UpdateTime'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Type'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'TimeToEmpty'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Online'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'EnergyRate'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'NativePath'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Model'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Serial'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'HasStatistics'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'EnergyFull'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'HasHistory'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'EnergyFullDesign'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Vendor'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'PowerSupply'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'State'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'TimeToFull'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'EnergyEmpty'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'IsRechargeable'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Technology'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Energy'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Voltage'
Oct 7 16:49:37 mika-laptop gnome-session[1419]: devkit-power-gobject-WARNING: unhandled property 'Capacity'

did:

 sudo killall devkit-power-daemon
  sudo /usr/lib/devicekit-power/devkit-power-daemon 2>&1 | tee /tmp/dkp.log

but that log was empty....

uname -a
Lin...

Read more...

Revision history for this message
Martin Pitt (pitti) wrote :

urho, I just uploaded a new gnome-session which fixes this problem.

Revision history for this message
chumba (splushkin) wrote :

Hi Martin,

I have exactly the same symptoms as Tristan in comment #14 and #16, except that I have regular desktop PC. Other symptoms are that all login process takes very long time (welcome screen, login name selection, desktop initialization). My daemon.log has plenty of "devkit-power-gobject-WARNING" lines: "Couldn't enumerate devices" and "Error invoking GetAll() to get properties".

  root@evergreen:[myhome]# uname -a
  Linux evergreen 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

  root@evergreen:[myhome]# ps -A -o pid,ppid,stat,wchan,args | grep power-daemon
   1880 1 D down /usr/lib/devicekit-power/devkit-power-daemon
   5392 4844 R+ - grep power-daemon

As you can see devkit-power-daemon is in uninterruptible state and kill -9 does not work.

Is there any way to provide you with any output showing the root cause of these delays and timeouts? Is there any way to disable this thing all together to get rid of annoying delays during bootup and runtime?
Since I'm on desktop which is actually functioning as my home 24*7 server I don't really care about power management.

Thanks

Revision history for this message
chumba (splushkin) wrote :

I just found a module causing this behavior. That was lirc_imon crashing at bootup. Attaching dmesg log piece of the crash. I'm not using it at the moment so I just disable it and everything started to work very smoothly. Thank you all for this bug report. It provided me with valuable hints.

This is pretty long chain of events though:
- infrared driver broken and crashes on bootup
- devkit-power-daemon dies because of that
- half of gnome gui becomes unresponsive on bootup and at runtime

It seems to me that gui should be less dependent on health of power management and power management should be way less dependent on well being of individual modules and drivers.
How come devkit-power-daemon is so vulnerable to such external and remote factors? Is there a fundamental problem preventing it from being more robust?

Thanks again and it would be nice to see your comments.

Revision history for this message
Martin Pitt (pitti) wrote :

After a kernel crash like this one, you can't really guarantee anything, I'm afraid. It would be great if you could report this as a bug against "linux", with the log attached. Thanks!

Revision history for this message
barenakeddali (bd-dali) wrote :

Hi, I also have problems with lirc_imon. After a fresh (network) install of Ubuntu 9.10, Gnome startup took about 10-15 minutes. During that time, the logs contained a lot of warnings like these:

Dec 14 21:44:03 zalmix x-session-manager[1651]: devkit-power-gobject-WARNING: Couldn't enumerate devices: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Dec 14 21:44:44 zalmix x-session-manager[1651]: devkit-power-gobject-WARNING: Error invoking GetAll() to get properties: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

I had the same problem in Kubuntu. Tried killing devkit-power-daemon, but it wouldn't die.

Blacklisting lirc_imon in /etc/modprobe.d/blacklist.conf solved all problems.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.