jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.86k stars 424 forks source link

Ubuntu version consumes too much cpu #269

Open elichai opened 8 years ago

elichai commented 8 years ago

After I updated my ubuntu version to 15.10 today Redshift-gtk started taking almost 100% of the cpu and even if I close it it's still taking much of the CPU until i kill -9 it. Here is the package policy:

redshift:   
  Installed: 1.10-5ubuntu1
  Candidate: 1.10-5ubuntu1
  Version table:
 *** 1.10-5ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ wily/universe amd64 Packages
        100 /var/lib/dpkg/status

Here is the data from top:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 3814 elichai2  20   0  493860   3424   2360 R  99.9  0.0 255:33.17 redshift-gtk

Thanks!

iKlsR commented 8 years ago

I had the same problem with flux or rather the xflux daemon.. using 100%. Not so for 14.10.

elichai commented 8 years ago

Still got that problem. I tried running strace redshift-gtk and I got this:

stat("/usr/share/locale-langpack/en/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, 0x7ffdb3a30010, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}], 5, 7192) = 1 ([{fd=5, revents=POLLIN}])
recvmsg(6, 0x7ffdb3a30010, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}], 5, 7192) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\2\0\0\0\0\0\0\0", 16)         = 8
recvmsg(6, 0x7ffdb3a30010, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}], 5, 7192) = 1 ([{fd=13, revents=POLLIN}])
read(5, 0x7ffdb3a301c0, 16)             = -1 EAGAIN (Resource temporarily unavailable)
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
read(13, "Color temperature: 5699K\n", 256) = 25
stat("/usr/share/locale/en_US.ISO8859-1/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale-langpack/en_US.ISO8859-1/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/en_US/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale-langpack/en_US/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/en.ISO8859-1/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale-langpack/en.ISO8859-1/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/en/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale-langpack/en/LC_MESSAGES/redshift.mo", 0x7ffdb3a2e8c0) = -1 ENOENT (No such file or directory)
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
recvmsg(6, 0x7ffdb3a30010, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}], 5, 7091) = 1 ([{fd=5, revents=POLLIN}])
recvmsg(6, 0x7ffdb3a30010, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}], 5, 7091) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\2\0\0\0\0\0\0\0", 16)         = 8
recvmsg(6, 0x7ffdb3a30010, 0)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}], 5, 7090^CProcess 16075 detached
 <detached ...>

Any Idea what causing the problem? Thanks!

ThePreviousOne commented 8 years ago

Ya Ubuntu. Joking aside try removing some of the none essential dependencies. I think Debuntu allows that

jonls commented 8 years ago

Thanks for the report @elichai. I'll look into this when I have more time on my hands.

mrbarletta commented 8 years ago

+1 - After resume cpu goes 100% -

Strace shows this (extract)

oll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 5, 4294967295) = 2 ([{fd=10, revents=POLLHUP}, {fd=12, revents=POLLHUP}]) recvmsg(6, 0x7ffd79cac4b0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 5, 4294967295) = 2 ([{fd=10, revents=POLLHUP}, {fd=12, revents=POLLHUP}]) recvmsg(6, 0x7ffd79cac4b0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 5, 4294967295) = 2 ([{fd=10, revents=POLLHUP}, {fd=12, revents=POLLHUP}]) recvmsg(6, 0x7ffd79cac4b0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}], 5, 4294967295) = 2 ([{fd=10, revents=POLLHUP}, {fd=12, revents=POLLHUP}]) recvmsg(6, 0x7ffd79cac4b0, 0) = -1 EAGAIN (Resource temporarily unavailable)

torzsmokus commented 7 years ago

I had the same issue now (eating 100% of a core of my cpu, strace showed the same as above over and over). Ubuntu 16.04 LTS. is there any update on this?