lightdm (1.2.3-0ubuntu2.6) 100%/high cpu usage

Bug #1431654 reported by timothymowens on 2015-03-13
74
This bug affects 14 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Critical
Unassigned

Bug Description

Since updating lightdm today, one core of my CPU is always maxed out at 100%. I rolled back to version 1.2.3-0ubuntu2.5 and the issue stopped. I tried this with 2 different kernels: 3.2.0-77-generic and 3.2.0-79-generic and and version 1.2.3-0ubuntu2.6 of lightdm still caused 100% cpu usage.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: lightdm 1.2.3-0ubuntu2.6
ProcVersionSignature: Ubuntu 3.2.0-77.114-generic 3.2.66
Uname: Linux 3.2.0-77-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu17.8
Architecture: amd64
Date: Thu Mar 12 20:20:12 2015
ExecutablePath: /usr/sbin/lightdm
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MarkForUpload: True
ProcEnviron:
 TERM=linux
 PATH=(custom, no user)
SourcePackage: lightdm
UpgradeStatus: No upgrade log present (probably fresh install)

timothymowens (timothymowens) wrote :
Robert Ancell (robert-ancell) wrote :

Do you have /var/log/lightdm/lightdm.log after this occurs? Thanks.

Changed in lightdm (Ubuntu):
importance: Undecided → Critical
timothymowens (timothymowens) wrote :

Here is the lightdm log file pulled from /var/log/lightdm/lightdm.log. At 98.76s, I logged out of my session, but didn't get a log-in screen again (black screen on both monitors).

At this point I killed the process (28882) so that I could downgrade lightdm again (from ctrl+alt+F1) and log back in.

Not sure if it's applicable, but the log that was generated was with kernel version 3.2.0-19-generic running. Also, the proprietary graphics driver I'm running at the moment is Nvidia v340.76. I also tested with v340.65 but still ran into the 100% cpu usage with the newest proposed lightdm service.

timothymowens (timothymowens) wrote :

I apologize, the version of the kernel that was running when log file was generated was 3.2.0-79-generic (not 3.2.0-19-generic). Sorry for the typo.

Robert Ancell (robert-ancell) wrote :

Process 28882 is the X server that has been started for the greeter.

Robert Ancell (robert-ancell) wrote :

Could you also get /var/log/lightdm/x-0-greeter.log?

timothymowens (timothymowens) wrote :

Here's the x-0-greeter.log file generated from lightdm v1.2.3-0ubuntu2.6.

timothymowens (timothymowens) wrote :

If it helps, here's the x-0-greeter.log file while running lightdm v1.2.3-0ubuntu2.5 (when the 100% usage doesn't occur).

m.faraway (m-faraway) wrote :

Fully confirm bug.
Ubuntu 12.04.5 LTS
3.2.0-79-generic-pae #115-Ubuntu SMP Thu Mar 12 14:33:25 UTC 2015 i686 i686 i386 GNU/Linux

Grégory (gregory-grosso) wrote :

Same bug here
Ubuntu 12.04.5 LTS
3.2.0-79-generic #115-Ubuntu SMP Thu Mar 12 14:18:19 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Same issues on Dell XPS developer edition:
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 1562 root 20 0 264m 3488 2836 R 100 0.0 13:25.13 lightdm

Ubuntu 12.04.
The issue start after last package update.

Launchpad Janitor (janitor) wrote :

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

Changed in lightdm (Ubuntu):
status: New → Confirmed
Filofel (filofel) wrote :

Same here, 32_bit:
3.2.0-79-generic #115-Ubuntu SMP Thu Mar 12 14:21:14 UTC 2015 i686 i686 i386 GNU/Linux

timothymowens (timothymowens) wrote :

FYI, in case there are some lesser experienced users that have this issue and are looking for a temporary solution for the time being, below are the instructions to revert to the previous release of lightdm until this gets resolved.

You can do this with the following command in a terminal (<CTRL + ALT + T>):

    sudo apt-get install lightdm=1.2.3-0ubuntu2.5

Then to kill the current lightdm session and start a new one using the previous released version, log out, then press <CTRL + ALT + F1>. Log into the fullscreen terminal session. Then type the following:

    sudo service lightdm stop

    sudo service lightdm start

Then to close the terminal session, press <CTRL + ALT + F1> once again, type exit, then <CTRL + ALT + F7> to return to your lightdm session. After that, you can log in and you're back to normal.

I also locked the lightdm package after reverting back for the time being so that I don't accidentally reinstall the broken version by doing the following in a terminal:

    sudo echo "lightdm hold" | dpkg --set-selections

Once this gets fixed or a new version is released later on, you can release the lock/hold with the following command in a terminal:

    sudo echo "lightdm install" | dpkg --set-selections

Hope that helps!

timothymowens (timothymowens) wrote :

Also, an addendum to the previous instructions, the Ubuntu repo that has version 1.2.3-0ubuntu2.5 of lightdm is the precise-updates repo. To add that repository, do the following:

From terminal:

    sudo gedit /etc/apt/sources.list

Add the following lines to the end of your file:

    ###### Ubuntu Update Repos
    deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse

Save changes, close the file, then run the following from Terminal:

    sudo apt-get update && sudo apt-get install lightdm=1.2.3-0ubuntu2.5

tags: added: regression-proposed
Robert Ancell (robert-ancell) wrote :

I'm still not able to reproduce this problem locally.

There are two patches that may be causing this problem: 09_close_pipes.patch and 11_quit_timeout.patch (the others seem unlikely to have caused a problem like this).

What would be very useful is if someone who is reproducing the problem can:
- Try building a package without either of the above patches and see which one is causing the problem. The packaging is in lp:~robert-ancell/lightdm/1.2.3-0ubuntu2.6 and can be built with bzr-buildpackage.
- Try building from lp:lightdm/1.2 with bzr-buildpackage. This contains more patches not SRU'd - perhaps one of these fixes this loop?
- Use gdb to find where in lightdm it is looping

More detailed instructions for building locally:
$ bzr branch lp:~robert-ancell/lightdm/1.2.3-0ubuntu2.6 lightdm-lp1431654
$ sudo apt-get build-dep lightdm
$ cd lightdm-lp1431654
(disable patches in debian/patches)
$ bzr-buildpackage
$ sudo dpkg -i ../build-area/lightdm_1.2.3-0ubuntu2.6_amd64.deb ../build-area/liblightdm-gobject-1-0_1.2.3-0ubuntu2.6_amd64.deb

timothymowens (timothymowens) wrote :

Hi Robert,

While I am a developer, I don't have much experience developing in Linux or using Bazaar (bzr). With that being said, I wasn't exactly sure how to disable a patch per say, so what I did was backed up 09_close_pipes.patch by moving it to my desktop, then issuing "touch 09_close_pipes.patch" to create a blank file with the same name. I then built the package and installed it. After restarting lightdm, I have no CPU issues any longer. So it would seem that the bug is indeed in 09_close_pipes.patch.

I hope this helps. I'll see if I can wrap my head around gdb to see if I can provide any more information.

timothymowens (timothymowens) wrote :

I may not be doing this correctly, but I ran the following to attempt to debug the running lightdm process using the package from the precise proposed ppa again. The command I ran is:

    sudo gdb lightdm 24513

Of course, 24513 was the running lightdm process. Interesting thing here is, once gdb output debug info, the process stopped utilizing 100% of my cpu. Once I quit gdb, the process started utilizing 100% of a cpu core once again.

If it helps, the debug output is in the attached file.

timothymowens (timothymowens) wrote :

To add to comment #17, just now I replaced my empty 09_close_pipes.patch file with the actual patch, then rebuilt, installed and restarted the lightdm process. Upon logging in, it's back to using 100% of a cpu core again. So when the 09 patch is removed, no high cpu usage. When the patch is put back in, cpu usage is high again.

Robert Ancell (robert-ancell) wrote :

@timothyowens - great work! Thanks for pinpointing the patch.

Robert Ancell (robert-ancell) wrote :

Could you try building with an updated version of the patch I've attached? It's a bit of a stab in the dark but I've fixed a potential case where stdout might get accidentally closed.

Robert Ancell (robert-ancell) wrote :

And it that doesn't work here is another updated patch.

timothymowens (timothymowens) wrote :

First patch didn't fix the issue:

root 11395 93.0 0.0 270668 3488 ? Rsl 22:26 1:00 lightdm
root 11401 12.3 1.2 263008 149876 tty7 Ss+ 22:26 0:08 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

I will try the 2nd one now.

timothymowens (timothymowens) wrote :

Unfortunately, the 2nd patch still produces the high cpu usage on one core:

root 2054 93.8 0.0 270668 3488 ? Rsl 22:35 1:40 lightdm
root 2091 10.4 1.3 283756 170820 tty7 Ss+ 22:35 0:11 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

Robert Ancell (robert-ancell) wrote :

Third times a charm :)

tags: added: patch
timothymowens (timothymowens) wrote :

Looks like that did it:

root 18958 0.0 0.0 270668 3496 ? Ssl 23:26 0:00 lightdm
root 18964 11.0 1.0 246424 133256 tty7 Ss+ 23:26 0:08 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

Good work!

Robert Ancell (robert-ancell) wrote :

It looks like the changes in 1.2.3-0ubuntu2.6 may have changed the timing slightly and exposed an existing bug (possibly bug 836616). @timothyowens tested a fix from lp:lightdm/1.2 so I've released 1.2.3-0ubuntu2.7 with that.

Changed in lightdm (Ubuntu):
status: Confirmed → Fix Committed
Grégory (gregory-grosso) wrote :

Thank's to @robert-ancell and @timothyowens.
Noob question : when will we see the new patch version in update manager ?

Hello timothymowens, or anyone else affected,

Accepted lightdm into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lightdm/1.2.3-0ubuntu2.7 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed

this new package lightdm/1.2.3-0ubuntu2.7
  is ok for me. thank

Le 19/03/2015 21:01, Brian Murray a écrit :
> Hello timothymowens, or anyone else affected,
>
> Accepted lightdm into precise-proposed. The package will build now and
> be available at
> https://launchpad.net/ubuntu/+source/lightdm/1.2.3-0ubuntu2.7 in a few
> hours, and then in the -proposed repository.
>
> Please help us by testing this new package. See
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
> enable and use -proposed. Your feedback will aid us getting this update
> out to other Ubuntu users.
>
> If this package fixes the bug for you, please add a comment to this bug,
> mentioning the version of the package you tested, and change the tag
> from verification-needed to verification-done. If it does not fix the
> bug for you, please add a comment stating that, and change the tag to
> verification-failed. In either case, details of your testing will help
> us make a better decision.
>
> Further information regarding the verification process can be found at
> https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
> advance!
>
> ** Tags added: verification-needed
>

paz (mozit) wrote :

The bug fixed for me on Linux paz 3.2.0-79-generic-pae #115-Ubuntu SMP Thu Mar 12 14:33:25 UTC 2015 i686 i686 i386 GNU/Linux
Thank you very much!

tags: added: verification-done
removed: verification-needed
timothymowens (timothymowens) wrote :

I can confirm as well that lightdm v1.2.3-0ubuntu2.7 has indeed fixed this issue for me. Thank you for the quick turnaround!

Urmel (thorsten-seidel) wrote :

Confirmation as well: Fix in 1.2.3-0ubuntu2.7 works, no longer high CPU usage.

Filofel (filofel) wrote :

Confirmation for the 32-bit version as well: 1.2.3-0ubuntu2.7 fixed it.
Thanks!

Ioann (yanunim95) wrote :

I can confirm this bug
Solution with package version 1.2.3-0ubuntu2.7 works.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.2.3-0ubuntu2.7

---------------
lightdm (1.2.3-0ubuntu2.7) precise; urgency=medium

  * debian/patches/15_gsources.patch:
    - Correctly remove GSources on finalize (LP: #1431654)

lightdm (1.2.3-0ubuntu2.6) precise; urgency=medium

  * debian/patches/09_close_pipes.patch:
    - Close pipes correctly (LP: #1190344)
  * debian/patches/10_conf_section_name.patch:
    - Correct section name in default users.conf (LP: #1069218)
  * debian/patches/11_quit_timeout.patch:
    - Destroy quit timeout when a process object is destroyed - fixes a crash
      where a deleted Process object might be accessed after a timeout
      (LP: #1207935)
  * debian/patches/12_layout_no_x11.patch:
    - Handle not getting an X connection when attempting to get X layouts
      (LP: #1235915)
  * debian/patches/13_introspection_makefile.patch:
    - Fix introspection build with newer versions of g-ir-scanner
  * debian/patches/14_compile_warnings.patch:
    - Fix compile warnings
 -- Robert Ancell <email address hidden> Tue, 17 Mar 2015 14:21:43 +1300

Changed in lightdm (Ubuntu):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for lightdm has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Other bug subscribers