pbbuttons pegs CPU when input event devices disappear

Bug #20149 reported by John Nowak on 2005-08-21
26
Affects Status Importance Assigned to Milestone
pbbuttonsd (Ubuntu)
Medium
Martin Pitt

Bug Description

excuse the lowercase, as my shift keys aren't working...
this new hardware detection isn't working well for me in colony 3...

after i get to the desktop in colony 3, if i open the terminal and
run 'top', it shows pbbuttons -- and sometimes scrollkeeper-up --
just pegging the processor. after killing them, the system runs
much more smoothly.

on an aluminum powerbook 1.25ghz, 1gb ram

Martin Pitt (pitti) wrote :

This has never occurred to me on my iBook G4. What are the exact steps to
reproduce this for you?

Matt Zimmerman (mdz) wrote :

*** Bug 20454 has been marked as a duplicate of this bug. ***

The same happens on my new iBook G4 (August 2005 model) with Hoary and Breezy.

How to reproduce?
Boot Ubuntu and pbbuttonsd will eat all CPU time it can get. The fan(s) will get
_loud_.
After an "sudo /etc/init.d/pbbuttonsd restart" it will be fine.

desrt (desrt) wrote :

"me too"

this only started happening recently (past week or two?)

root@gala:~# strace -p `pidof pbbuttonsd`
[...]
select(10, [3 4 5 6 9], NULL, NULL, {0, 10000}) = 1 (in [5], left {0, 10000})
read(5, 0x7fbc09e0, 16) = -1 ENODEV (No such device)
select(10, [3 4 5 6 9], NULL, NULL, {0, 10000}) = 1 (in [5], left {0, 10000})
read(5, 0x7fbc09e0, 16) = -1 ENODEV (No such device)
select(10, [3 4 5 6 9], NULL, NULL, {0, 10000}) = 1 (in [5], left {0, 10000})
read(5, 0x7fbc09e0, 16) = -1 ENODEV (No such device)
[...]
Process 3813 detached

root@gala:~# ls -l /proc/3813/fd/
total 8
lrwx------ 1 root root 64 2005-08-28 22:29 10 -> socket:[6228]
lr-x------ 1 root root 64 2005-08-28 22:29 3 -> /dev/input/event1
lr-x------ 1 root root 64 2005-08-28 22:29 4 -> /dev/input/event2
lr-x------ 1 root root 64 2005-08-28 22:29 5 -> /dev/input/event4 (deleted)
lr-x------ 1 root root 64 2005-08-28 22:29 6 -> /dev/input/mice
lrwx------ 1 root root 64 2005-08-28 22:29 7 -> /dev/pmu
lrwx------ 1 root root 64 2005-08-28 22:29 8 -> /dev/adb
lrwx------ 1 root root 64 2005-08-28 22:29 9 -> /dev/pmu

Martin Pitt (pitti) wrote :

A similar bug already occurred in Debian and was fixed with a new upstream
version. I tried hard, but I cannot reproduce the bug (I deleted the devices,
and so on). I also tried to add a simple patch that drops invalid devices, but
it doesn't work so far.

Can you please download

  http://people.ubuntu.com/~pitti/packages/pbbuttonsd_0.7.1-1ubuntu1_powerpc.deb

install it with

  sudo dpkg -i pbbuttonsd_0.7.1-1ubuntu1_powerpc.deb

and check whether it works then? If so, I will try to isolate the patch and
backport it to our current version.

Francesco Accattapà (callipeo) wrote :

(In reply to comment #5)

Installing that version of pbbuttonsd solved the problem on my system (iBook G4)

(In reply to comment #5)

> http://people.ubuntu.com/~pitti/packages/pbbuttonsd_0.7.1-1ubuntu1_powerpc.deb

It works on my iBook with 1.33GHz G4.

Dan Young (dan-young-parkrose) wrote :

(In reply to comment #5)
> http://people.ubuntu.com/~pitti/packages/pbbuttonsd_0.7.1-1ubuntu1_powerpc.deb

I had the runaway pbbuttonsd on my 15" 1.33GHz Powerbook5,4
Works fine w/ the above v0.7.1.

Matt Zimmerman (mdz) wrote :

*** Bug 21339 has been marked as a duplicate of this bug. ***

(In reply to comment #5)
> http://people.ubuntu.com/~pitti/packages/pbbuttonsd_0.7.1-1ubuntu1_powerpc.deb

It solves the problem on my iBook G4 1,07 GHz too.

Martin Pitt (pitti) wrote :

OK, thanks to everybody for testing. I will try to isolate the change and port
it to Breezy's version.

(In reply to comment #11)
> OK, thanks to everybody for testing. I will try to isolate the change and port
> it to Breezy's version.

Hi I have a powerbook 5,4 (1.5ghz aluminum) also, and I had the problem with the
100% cpu usage upon boot. Installing this version helped the 100% cpu usage, as
that is no longer a factor, but I do still have to "sudo /etc/init.d/pbuttonsd
restart" before I can login to gnome. I am running breezy, I update it everyday
so it is very current. Basically when I login X will crash if pbuttonsd is not
restarted first. Before this patch, X would work fine, log in and all, but then
it would be at 100% cpu usage until the restart, so for me it's really still the
same problem because I still have to restart the pbuttons daemon.

Thanks, this distro really is amazing, I am so impressed with it.
-Scott

(In reply to comment #12)
> (In reply to comment #11)
> > OK, thanks to everybody for testing. I will try to isolate the change and port
> > it to Breezy's version.
>
> Hi I have a powerbook 5,4 (1.5ghz aluminum) also, and I had the problem with the
> 100% cpu usage upon boot. Installing this version helped the 100% cpu usage, as
> that is no longer a factor, but I do still have to "sudo /etc/init.d/pbuttonsd
> restart" before I can login to gnome. I am running breezy, I update it everyday
> so it is very current. Basically when I login X will crash if pbuttonsd is not
> restarted first. Before this patch, X would work fine, log in and all, but then
> it would be at 100% cpu usage until the restart, so for me it's really still the
> same problem because I still have to restart the pbuttons daemon.
>
> Thanks, this distro really is amazing, I am so impressed with it.
> -Scott

Sorry I fixed this myself, but I think it could still be considered a bug. I
had additional keyboard options specified in my xorg.conf. That was causing the
crash. I went back to the default xorg.conf file, and everything works great
now. Thank you.

Martin Pitt (pitti) wrote :

(In reply to comment #13)

> Sorry I fixed this myself, but I think it could still be considered a bug. I
> had additional keyboard options specified in my xorg.conf. That was causing the
> crash. I went back to the default xorg.conf file, and everything works great
> now. Thank you.

Sorry, no idea of what you are talking about. You mean pbbuttonsd crashed
because you had some special keyboard configuration in xorg.conf? Can you plese
file a separate bug about that?

Martin Pitt (pitti) wrote :

Thanks to everybody for testing. I (hope that I correctly) backported the fix to
the Breezy version. Can you please do the same round of testing again?

Please download

  http://people.ubuntu.com/~pitti/packages/pbbuttonsd_0.6.6-3ubuntu5_powerpc.deb

and install it with

  sudo dpkg -i pbbuttonsd_0.6.6-3ubuntu5_powerpc.deb

Then please check if the bug is still fixed.

Thanks in advance!

It still eats CPU un my system.

(In reply to comment #16)
> It still eats CPU un my system.

Are you sure it is pbbuttonsd? Martin's backport works for me, but
update-notifier stresses my cpu at the moment (bug #36215).

(In reply to comment #17)
> Are you sure it is pbbuttonsd?

Yes:

france@localhost:~$ ps aux --sort -pcpu
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 4495 79.8 0.0 1820 724 ? Rs 19:17 7:25
/usr/bin/pbbuttonsd --configfile=/etc/pbbuttonsd.conf -d
france 5559 8.3 2.0 46420 15988 ? Sl 19:26 0:03 gnome-terminal
[.......]

These are the last lines of an strace of the pbbuttonsd PID:

---------------------------------------------------------------------------------
select(11, [3 4 5 6 10], NULL, NULL, {0, 10000}) = -1 EBADF (Bad file descriptor)
select(11, [3 4 5 6 10], NULL, NULL, {0, 10000}) = -1 EBADF (Bad file descriptor)
select(11, [3 4 5 6 10], NULL, NULL, {0, 10000}) = -1 EBADF (Bad file descriptor)
select(11, [3 4 5 6 10], NULL, NULL, {0, 10000}) = -1 EBADF (Bad file descriptor)
select(11, [3 4 5 6 10], NULL, NULL, {0, 10000}) = -1 EBADF (Bad file descriptor)
---------------------------------------------------------------------------------

And these are the last lines of an ltrace of the same process:

------------------------------------------------------
select(11, 0x7fed9ac8, 0, 0, 0x7fed9a68) = -1
select(11, 0x7fed9ac8, 0, 0, 0x7fed9a68) = -1
select(11, 0x7fed9ac8, 0, 0, 0x7fed9a68) = -1
select(11, 0x7fed9ac8, 0, 0, 0x7fed9a68) = -1
select(11, 0x7fed9ac8, 0, 0, 0x7fed9a68) = -1
------------------------------------------------------

desrt (desrt) wrote :

step 1: stock breezy system
step 2: reboot
step 3: observe pbbuttonsd is using 100% cpu
step 4: install this .deb
step 5: reboot
step 6: everything is nice

ie: the attached deb appears to fix the problem for me!

Martin Pitt (pitti) wrote :

So it seems to work for 2/3 people. I uploaded this intermediate version:

 pbbuttonsd (0.6.6-3ubuntu5) breezy; urgency=low
 .
   * Port event device handling bug fixes from 0.6.10 release. This should
     fix some of the "100% CPU usage bugs". (Ubuntu #13909)

However, there are so many bug fixes between 0.6.6 and 0.7.1, and the CVS is so
useless that it is difficult to find the solution for the remaining bug. Matt,
are you entirely opposed to merging the current version (0.7.1)? It has an
impressive changelog, though:

  http://pbbuttons.sourceforge.net/projects/pbbuttonsd/changelog.html

Matt Zimmerman (mdz) wrote :

(In reply to comment #20)
>
> However, there are so many bug fixes between 0.6.6 and 0.7.1, and the CVS is so
> useless that it is difficult to find the solution for the remaining bug. Matt,
> are you entirely opposed to merging the current version (0.7.1)? It has an
> impressive changelog, though:
>
> http://pbbuttons.sourceforge.net/projects/pbbuttonsd/changelog.html

Has it been verified that this version fixes the problem for those who are still
experiencing it? Which other packages interact with pbbuttonsd and would need
to be tested?

(In reply to comment #21)
> Has it been verified that this version fixes the problem for those who are still
> experiencing it?

As for myself, yes, the package linked in the comment #5 solves the problem.

Martin Pitt (pitti) wrote :

(In reply to comment #21)
> Has it been verified that this version fixes the problem for those who are still
> experiencing it?

Yes.

> Which other packages interact with pbbuttonsd and would need to be tested?

We need to test the mixer applet (volume keys), suspend/resume, the interaction
with the Gnome logout dialog (#14338 is fixed in the current Breezy package, but
not yet in the test 0.7.1 package I linked in this bug, but it's a conf change
only), and that power management (CPU throttling, battery capacity handling)
works. I basically already did all of this. Did any other tester notice any
regression?

Martin Pitt (pitti) wrote :

Please also see #15251, 0.7.1 seems to fix a couple of other major bugs.

(In reply to comment #23)
> Did any other tester notice any regression?

I cannot suspend using the proper button in the Gnome logout dialog.
0.6.6-3ubuntu5 works as expected.

Matt Zimmerman (mdz) wrote :

> We need to test the mixer applet (volume keys), suspend/resume, the interaction
> with the Gnome logout dialog (#14338 is fixed in the current Breezy package, but
> not yet in the test 0.7.1 package I linked in this bug, but it's a conf change
> only), and that power management (CPU throttling, battery capacity handling)
> works. I basically already did all of this. Did any other tester notice any
> regression?

Let's go ahead with the update; of course please follow up on the issue
mentioned in comment #25

Martin Pitt (pitti) wrote :

(In reply to comment #25)
> (In reply to comment #23)
> > Did any other tester notice any regression?
>
> I cannot suspend using the proper button in the Gnome logout dialog.
> 0.6.6-3ubuntu5 works as expected.

Hm, this somewhat contradicts your followup in #12198. I cannot suspend in the
Gnome dialog with 0.6.6 either, BTW.

Anyway, I will look into this.

(In reply to comment #27)
> Hm, this somewhat contradicts your followup in #12198.

Not really. I guess I should elaborate a little further. #12198 means that I
cannot see a suspend button in the logout dialog if gdm is started after
pbbuttonsd, while what I meaned in comment #25 is that, if I start gdm after
pbbuttonsd, I can't use that button to suspend using pbbuttonsd 0.7.1

Martin Pitt (pitti) wrote :

(In reply to comment #25)
> (In reply to comment #23)
> > Did any other tester notice any regression?
>
> I cannot suspend using the proper button in the Gnome logout dialog.
> 0.6.6-3ubuntu5 works as expected.

OK, I now know the reason for that. pbbcmd has a slightly different syntax for
sleep now, so powermanagement-interface must be updated. Trivial change, I will
do that soon.

Martin Pitt (pitti) wrote :

 pbbuttonsd (0.7.1-1ubuntu1) breezy; urgency=low
 .
   * Merge Debian changes (Ubuntu #12091)
     - Should fix more 100% CPU usage bugs. (Ubuntu #13909)
     - Fixes "plasma effect" and broken volume keys on some models (parts of
       Ubuntu #15251)
   * Move init script priority from 20 to 12 to start before gdm.
     (Ubuntu #12198)
   * debian/pbbuttonsd.preinst: Transition code for removing old (prio 20)
     init.d symlinks on upgrade.

Martin Pitt (pitti) wrote :

(In reply to comment #29)
> (In reply to comment #25)
> > (In reply to comment #23)
> > > Did any other tester notice any regression?
> >
> > I cannot suspend using the proper button in the Gnome logout dialog.
> > 0.6.6-3ubuntu5 works as expected.
>
> OK, I now know the reason for that. pbbcmd has a slightly different syntax for
> sleep now, so powermanagement-interface must be updated. Trivial change, I will
> do that soon.

Fixed in:

 powermanagement-interface (0.3.5) breezy; urgency=low
 .
   * Adapt to new pbbuttonsd:
     - pmi.pbb: Change sleep command from "pbbcmd config TAG_GOTOSLEEP 1" to
       "pbbcmd sleep". (See Ubuntu #13909)
     - debian/rules: Bump versioned dependency.

To post a comment you must log in.
This report contains Public information  Edit
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.