upowerd uses 100% cpu till killed

Bug #861642 reported by mustangtyson
130
This bug affects 28 people
Affects Status Importance Assigned to Milestone
Upower
New
Undecided
Unassigned
upower (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

top - 12:57:54 up 2:56, 3 users, load average: 1.06, 1.12, 1.35
Tasks: 219 total, 2 running, 216 sleeping, 0 stopped, 1 zombie
Cpu0 : 70.2%us, 29.8%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 2.3%us, 1.3%sy, 0.0%ni, 96.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 1.0%us, 0.3%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.7%us, 1.6%sy, 0.0%ni, 97.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 0.0%us, 0.3%sy, 0.0%ni, 98.3%id, 1.4%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 5994176k total, 4198260k used, 1795916k free, 63308k buffers
Swap: 8193144k total, 355188k used, 7837956k free, 334316k cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 2268 root 20 0 148m 1572 680 R 100 0.0 111:08.37 upowerd

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: upower 0.9.9-4
ProcVersionSignature: Ubuntu 2.6.38-11.50-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Wed Sep 28 12:53:23 2011
ExecutablePath: /usr/lib/upower/upowerd
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
ProcEnviron:

SourcePackage: upower
UpgradeStatus: Upgraded to natty on 2011-04-06 (175 days ago)

Revision history for this message
mustangtyson (tysonsmith) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upower (Ubuntu):
status: New → Confirmed
Revision history for this message
zenith (lasse-bigum) wrote :

I'm having this problem on a daily basis now - how can I help debugging?

I would like to attach a strace of the upowerd daemon but I can't get this to work:
sudo strace -v -t -p 5399
I attaches but shows no output? And still it keeps churning away burning 100% CPU:
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 5399 root 20 0 27248 4432 3760 R 98 0.1 29:26.92 upowerd

Revision history for this message
Quinta Helmer (qhelmer) wrote :

This problem may be (partly) related to connecting an iphone or ipod to the computer. I just ran into it on Oneiric after having my ipod connected and searching the web led me to this bug and several sites mentioning this problem in relation to an iphone.

Also this may be a duplicate of #876279 and for the ipod/iphone part #611020 is related.

Revision history for this message
Bug Reporter 11 (bugreporter11) wrote :

I"m seeing this in Kubuntu 15.10 on two different PC's (a laptop and a desktop).

Revision history for this message
jmervine (u-joshua) wrote :

I wanted to confirm that I saw this issue after connecting an iPhone.

Revision history for this message
Mikko Rantalainen (mira) wrote :

Duplicate bug 876279 ?

Revision history for this message
ally (allywilson) wrote :

Just had this issue. Linux Mint 18. Unlocked connected iPhone, selected "Trust this computer" from the prompt that was sitting there from when I connected it via USB, and upowerd CPU usage went down to 0.0.

Revision history for this message
flo-54321 (flo-54321) wrote :

I can confirm the observation of ally (#8).

Revision history for this message
Mike Myers (fristle) wrote :
Download full text (3.7 KiB)

I would like to use my Linux system to charge up my iOS devices, but I don't want to "Trust this Computer" so maybe we can drill down further on this bug.

As soon as I connect a locked iDevice (tested iOS 9 and iOS 10):

$ top

top - 12:22:28 up 24 days, 21:05, 2 users, load average: 0.50, 0.56, 0.84
Tasks: 222 total, 2 running, 220 sleeping, 0 stopped, 0 zombie
%Cpu(s): 37.7 us, 2.8 sy, 0.0 ni, 59.1 id, 0.5 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3917996 total, 228612 free, 2176052 used, 1513332 buff/cache
KiB Swap: 4063228 total, 3597580 free, 465648 used. 1188276 avail Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 2184 root 20 0 348112 5596 4800 R 70.4 0.1 3886:07 upowerd

upowerd itself doesn't tell me much:

$ upower --monitor
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[15:26:55.169] device added: /org/freedesktop/UPower/devices/media_player_1_1

$ upower --monitor-detail
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[15:28:23.805] device added: /org/freedesktop/UPower/devices/media_player_1_1
  native-path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1
  vendor: Apple_Inc.
  model: iPod
  serial: 8b1d0ada9c849c62fd52263c3797034216608bf0
  power supply: no
  updated: Wed 31 Dec 1969 07:00:00 PM EST (1477682903 seconds ago)
  has history: yes
  has statistics: no
  media-player
    warning-level: none
    percentage: 0%
    icon-name: 'battery-missing-symbolic'

perf top: it shows the top four items to be libgmp.so.10.3.0 in:
 __gmpn_redc_1
 __gmpn_sqr_basecase
 __gmpn_mul_basecase
 __gmpz_probab_prime_p

`perf top --sort=comm,dso` shows that the top item is upowerd, in libgmp.so.10.3.0

This is a math library. I can only guess, but it may be doing math operations to compute the UDID of the iOS device every time it tries to communicate with it? Some SHA1 operations maybe.

To use strace on the upowerd process (PID 2184):

$ sudo strace -p 2184 -c
strace: Process 2184 attached
strace: [ Process PID=2184 runs in x32 mode. ]
strace: [ Process PID=2184 runs in 64 bit mode. ]
^Cstrace: Process 2184 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
 58.05 0.000101 1 96 sendto
 41.95 0.000073 0 14494 getrusage
  0.00 0.000000 0 24 close
  0.00 0.000000 0 30 6 stat
  0.00 0.000000 0 6 poll
  0.00 0.000000 0 96 select
  0.00 0.000000 0 24 socket
  0.00 0.000000 0 24 connect
  0.00 0.000000 0 96 recvfrom
------ ----------- ----------- --------- --------- ----------------
100.00 0.000174 14890 6 total

$ sudo strace -p 2184 -e sendto -i
This shows that it is sending XML messages over and over again. For fuller output you can add `-s 999` ... ...

Read more...

Revision history for this message
Heimen Stoffels (vistaus) wrote :

I'm also experiencing this issue but I don't have any device connected (I don't even any iDevice at all!).

Revision history for this message
Max Barry (max-maxbarry) wrote :

Same as #8 with iPhone 6 and Ubuntu 16.10. CPU usage vanishes upon tapping "Trust" on phone.

Revision history for this message
Anatoli (anatoli) wrote :

Same here, iPhone 6S and Ubuntu 16.04. When iPhone is connected, upowerd consumes some 50% of CPU, when the PC is marked as trusted in the iPhone, no CPU usage by upowerd.

Revision history for this message
jason ubuntunone (jasonubuntuone) wrote :

I'm seeing the same thing in Linux Mint. iPhone 6 connectet, high cpu usage. Hit trust and CPU drops to 0.
Linux myhostname 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Jesus Cea (jcea) wrote :

I am having the same problem with an iPhone too. "Trusting" the computer in the Phone temporally solves it but I don't want to trust the computer if I can avoid it :-).

Any debug we can help out?

Revision history for this message
Dennis (moneysac) wrote :

This bug was posted in 2011 and is still present in 2018. My version:

Linux thinkpad 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Mikko Rantalainen (mira) wrote :

Any updates? The diagnosis in comment #10 seems to make sense. This has been a problem since 2011 and I still see the same issue on Ubuntu 16.04 LTS with latests patches.

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

Other bug subscribers

Remote bug watches

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