Returning to existing session is unreliable and can leave on blank screen

Bug #1656399 reported by v
70
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Fix Released
High
Robert Ancell
1.10
Fix Committed
High
Unassigned
1.18
Fix Committed
High
Unassigned
1.20
Fix Committed
High
Unassigned
lightdm (Ubuntu)
Fix Released
Critical
Robert Ancell
Trusty
Triaged
Medium
Unassigned
Xenial
Triaged
Medium
Unassigned
Yakkety
Triaged
Medium
Unassigned

Bug Description

[Impact]
Due to a logic bug LightDM returning to an existing session from a greeter can be unreliable. This case is common in systems which use the greeter as a lock screen.

The bug was introduced in revision 1954 to fix bug 1296276. The race condition seems to have been made more likely to the change in revision 2437 to fix bug 1637758.

[Test Case]
1. Log into a session
2. Switch to the greeter (e.g. dm-tool switch-to-greeter)
3. Log in again

Expected result
Returned to existing session

Observed result
Not always returned, can end up on blank screen. Since this is a race condition this may not occur on some systems.

[Regression Potential]
Low, the fix is to correct a logic bug that made LightDM think it hadn't stopped a session correctly.

Revision history for this message
v (v-) wrote :

Acer S7 - Intel Haswell Laptop with Intel GPU using i915 driver.

Revision history for this message
v (v-) wrote :
Revision history for this message
v (v-) wrote :

The same behavior can be replicated by letting the screen lock itself due to idle, or by locking your workstation.

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

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

Changed in light-locker (Ubuntu):
status: New → Confirmed
Revision history for this message
Kev Bowring (flocculant) wrote :

See this on desktop with nvidia.

Note:

lock then unlock
see cursor flashing in corner of vt8

Playing music prior to locking - muic muted (as expected)
When trying to unlock music can be momentarily heard until lock screen shows again

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1656399

tags: added: iso-testing
Revision history for this message
Kev Bowring (flocculant) wrote :

Downgraded lightdm packages as follows:

1.21.1-0ubuntu1 locking works suspend works

1.21.1-0ubuntu2 locking works suspend works

1.21.2-0ubuntu not downloadable

1.21.3-0ubuntu1 no locking

Revision history for this message
Kev Bowring (flocculant) wrote :

however - seems locking fails in vm with 1.21.1-0ubuntu2

Revision history for this message
Kev Bowring (flocculant) wrote :

attached lightdm.log following failure to unlock

Sean Davis (bluesabre)
Changed in light-locker (Ubuntu):
importance: Undecided → Critical
Changed in lightdm (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Kev Bowring (flocculant) wrote :

affects lubuntu

Revision history for this message
Kev Bowring (flocculant) wrote :

Error in comment #7

1.21.1-0ubuntu2 does not allow locking

tags: added: lubuntu xubuntu zesty
Revision history for this message
Robert Ancell (robert-ancell) wrote :

The change in there is:

  Restore patch from 1.20.0-0ubuntu3:
  * Add debian/patches/terminate-session.patch: Terminate leftover processes
    in greeter session. It can happen that the greeter session does not
    properly clean up itself on logout. This causes leaked processes like
    settings-daemon which act on the user session as they share the same
    $DISPLAY. Ask logind to terminate remaining processes in the greeter
    session on closing, which is more robust than trying to fix every greeter.
    (LP: #1637758)

 -- Martin Pitt <email address hidden> Tue, 22 Nov 2016 09:43:39 +0100

Which suggests that the issue might be lightdm-gtk-greeter being killed before the unlock has completed?

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Actually the relevant part of the lightdm.log is:

[+7580.55s] DEBUG: Seat seat0: Returning to existing user session wolf
[+7580.55s] DEBUG: Unlocking login1 session c2
[+7580.55s] DEBUG: Activating VT 7
[+7580.67s] DEBUG: Seat seat0: Stopping greeter
[+7580.67s] DEBUG: Terminating login1 session c6
[+7580.69s] DEBUG: Session pid=13835: Sending SIGTERM
[+7580.69s] DEBUG: Activating login1 session c2
[+7580.70s] WARNING: Failed to flush data to greeter: Broken pipe
[+7580.70s] DEBUG: Greeter closed communication channel
[+7580.70s] DEBUG: Session pid=13835: Terminated with signal 1

Which suggests the greeter is not exiting cleanly. This suggests:
- The change to the method by which lightdm kills the greeter might not be handled well by lightdm-gtk-greeter.
- There's probably a bug in lightdm in that it asked the greeter to quit, so it shouldn't care if it doesn't exit cleanly in this case.
- We need the greeter log to know more about what happened there.

Revision history for this message
Kev Bowring (flocculant) wrote :

Greeter log

Revision history for this message
Kev Bowring (flocculant) wrote :

Checked with gnome-screensaver and xscreensaver instead of light-locker.

In both cases -

lock and suspend both work as expected.

lock then login as new user fails to allow you back to original use

downgrading lightdm to 1.21.1-0ubuntu1 allows lock and login as new user, however both require user to login twice to gain access to locked desktop

Revision history for this message
Kev Bowring (flocculant) wrote : Re: Unable to unlock session after suspend using lightdm-gtk-greeter.

was going to check the budgie greeter - but that uses lightdm-gtk-greeter and fails the same as with other flavours

tags: added: budgie
summary: - Unable to unlock Xubuntu XFCE session after suspend.
+ Unable to unlock session after suspend using lightdm-gtk-greeter.
Revision history for this message
sudodus (nio-wiklund) wrote :

This bug seems to affect Lubuntu Zesty alpha 2. It affects all Lubuntu test cases.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

It turns out I can reproduce this with unity-greeter (on zesty). I get the following:
1. Log into session from greeter
2. Switch to greeter and log in again
(returned to session)
3. Switch to greeter and log in again
Switched to black screen, can manually VT switch back to session but need to unlock it from screen locker.
4. Switch to greeter and log in again
Returned to session, but screen locker shown.

There were a couple of bugs regarding signals and return values from greeters which I have fixed in lp:lightdm, but these don't seem to have caused the issue.

Still investigating...

Changed in lightdm (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
status: Confirmed → In Progress
Revision history for this message
Ian Bruntlett (ian-bruntlett) wrote :

It happens to me, too.
======================
Something (big) cropped up. When I returned to my NetBook, the screen had locked. Typed my password in. System then (visually) unlocked itself, paused briefly and then locked me back out again. You can test this more quickly by using the keyboard shortcut of CTRL+ALT+l

Naturally I thought I'd got the password wrong. Tried typing in the password in upper case and it didn't do the above - it gave a red error message, pretty much expected.

The only way I could get into a locked system again was to chose a "Shutdown" menu option.

Played around with it for a bit. Managed to unlock the NetBook successfully once - then it resumed its unhelpful behaviour.

And here are my system's details.
=================================
On 28 January 2017 at 02:55, Simon Quigley <email address hidden> wrote:

    Lubuntu Zesty Zapus Alpha 2 (soon to be 17.04) has been released!

OK. Used your link and downloaded MD5SUMS and zesty-desktop-i386.iso. Ran md5sum and it checked out OK:-
1c3f420bb80754bc3b31eb479d77e3b5 zesty-desktop-i386.iso

Used Startup Disc Creator on a 4GB USB flash drive.

Hardware used to install iso on:

Samsung NC10 - hawking
Intel Atom N270, 1.66GHz, 32-bit, 2GiB RAM, 149.05 GiB hard drive, no optical drive, Ethernet and WiFi connections
Full details see here:- https://gist.github.com/21b61903871ee685fc79

Booted install media without Ethernet cable connected. Had to reboot system after connecting Ethernet cable before it was happy to continue the update. Opted for "Download updates while installing Lubuntu" and "Install third-party software". Chose option to wipe hard drive and install Lubuntu on top of it. Put in a hostname of "hawking" for this NetBook. Installer said there was already another system on the network called "hawking". Decided not to argue so named the system "hawking2".

Install completed successfully and asked for the (installation) storage medium at a suitable time.

Rebooted system, logged in. The start/swift menu icon isn't present. Ran Software Updater OK. Saw an email on lubuntu-devel complaining about Firefox not working. On my NetBook, ran Firefox (version 50.1.0) ran fine and I Googled "Hello World".

Normally I only use the "alternate" iso images and in the install I repartition the hard drive manually. For some reason I did it a little differently this time :)

Revision history for this message
AJ Fite (goldman60) wrote :

This is effecting me on Xubuntu 17.04

Intel Skylake i7 with HD530 Graphics (Lenovo Thninkpad T460s)

Rikhi Bose (rikhi)
Changed in light-locker (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Kev Bowring (flocculant) wrote :

really wish people wouldn't fiddle with bug status

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2017-02-20 08:27, flocculant wrote:
> really wish people wouldn't fiddle with bug status

Reversed the latest change.

Changed in light-locker (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Kev Bowring (flocculant) wrote :

@Gunnar - thank you

Revision history for this message
Kev Bowring (flocculant) wrote :

@robert - I've seen reports from xubuntu testers where it was sometimes working. So I tried more on a completely brand new installation.

Lock - unlock fails - this continued for 3 attempts at which point I reached desktop.
Lock and unlock cycle next time took 2 attempts.
Lock and unlock cycle next time took 1 attempt.

I was then able to lock and unlock at will.

Attached all /var/log/lightdm logs from that session.

Revision history for this message
Kev Bowring (flocculant) wrote :
Revision history for this message
Kev Bowring (flocculant) wrote :
Revision history for this message
Kev Bowring (flocculant) wrote :

In my used and abused installation I see similar behaviour.

Revision history for this message
Henk Terhell (hterhell) wrote :

Same experience on my updated Lubuntu 17.04.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

I'm also finding it to be unreliable. It seems to be a race condition between the greeter quitting and the session starting. I suspect the use of logind has made this race more likely.

no longer affects: lightdm/1.21
summary: - Unable to unlock session after suspend using lightdm-gtk-greeter.
+ Returning existing session is unreliable and can leave on blank screen
summary: - Returning existing session is unreliable and can leave on blank screen
+ Returning to existing session is unreliable and can leave on blank
+ screen
description: updated
description: updated
Changed in lightdm:
importance: Undecided → High
milestone: none → 1.21.5
status: New → Fix Committed
no longer affects: light-locker (Ubuntu)
no longer affects: light-locker (Ubuntu Trusty)
no longer affects: light-locker (Ubuntu Yakkety)
no longer affects: light-locker (Ubuntu Xenial)
Changed in lightdm:
assignee: nobody → Robert Ancell (robert-ancell)
Changed in lightdm (Ubuntu Trusty):
status: New → Triaged
Changed in lightdm (Ubuntu Xenial):
status: New → Triaged
Changed in lightdm (Ubuntu Yakkety):
status: New → Triaged
Changed in lightdm (Ubuntu Trusty):
importance: Undecided → Medium
Changed in lightdm (Ubuntu Yakkety):
importance: Undecided → Medium
Changed in lightdm (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Robert, any chance we can get this fix in Zesty Archive in debian/patches? I can help with packaging if needed (if you aren't working on it already).

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Uploaded to zesty as 1.21.5-0ubuntu1.

Changed in lightdm:
status: Fix Committed → Fix Released
Revision history for this message
Robert Ancell (robert-ancell) wrote :

The change fixes the issue for me, though of course it may not be the only issue affecting screen locking with light-locker (as per the original bug description). If you continue to have problems please comment here an open a new bug and we'll tackle further issues there. Thanks for all the great feedback in this bug!

Revision history for this message
Kev Bowring (flocculant) wrote :

@ Robert - grabbed from -proposed.

Locking from desktop appears to work as expected.

Unlocking from suspend - I get hiccups if I'm a bit quick entering password (bug 1666803)

Revision history for this message
- (peppekorg-deactivatedaccount-deactivatedaccount) wrote :

Installing 1.21.5-0ubuntu1 has solved the problem coming out from lock screen

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

This bug was fixed in the package lightdm - 1.21.5-0ubuntu1

---------------
lightdm (1.21.5-0ubuntu1) zesty; urgency=medium

  * New upstream release:
    - Fix logic that checked if a session was being stopped.
      This fixes a race condition that could cause logging into an existing
      session from a greeter to not return to that session. (LP: #1656399)

 -- Robert Ancell <email address hidden> Wed, 22 Feb 2017 12:38:50 +1300

Changed in lightdm (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
AJ Fite (goldman60) wrote :

The new version has fixed the issue for me!

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

Other bug subscribers

Related blueprints

Remote bug watches

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