After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 749418 - GDM autologin breaks logout
GDM autologin breaks logout
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-15 10:07 UTC by Daniel Tobias
Modified: 2015-10-17 14:33 UTC
See Also:
GNOME target: 3.18
GNOME version: ---


Attachments
snippet from journal (16.30 KB, text/plain)
2015-05-19 16:49 UTC, Daniel Tobias
  Details
gdm-no-autologin.log (384.94 KB, text/plain)
2015-09-07 19:23 UTC, Federico Mena Quintero
  Details
gdm-autologin.log (224.69 KB, text/plain)
2015-09-07 19:24 UTC, Federico Mena Quintero
  Details
Annotated gdm-no-autologin.log (312.91 KB, text/plain)
2015-09-08 22:28 UTC, Federico Mena Quintero
  Details
Annotated gdm-autologin.log (151.79 KB, text/plain)
2015-09-08 22:28 UTC, Federico Mena Quintero
  Details
Annotated gdm-no-autologin.log (313.21 KB, text/plain)
2015-09-08 23:06 UTC, Federico Mena Quintero
  Details
local-display-factory: spacing clean up (3.13 KB, patch)
2015-09-10 13:57 UTC, Ray Strode [halfline]
committed Details | Review
local-display-factory: call sync function after display finishes (6.54 KB, patch)
2015-09-10 13:57 UTC, Ray Strode [halfline]
committed Details | Review
manager: don't muck with the session type and class of stub display (autologin) (3.16 KB, patch)
2015-09-10 13:57 UTC, Ray Strode [halfline]
committed Details | Review
manager: fix display leak (3.82 KB, patch)
2015-09-10 13:57 UTC, Ray Strode [halfline]
committed Details | Review
manager: make sure user session displays have a seat assigned (3.44 KB, patch)
2015-09-10 13:57 UTC, Ray Strode [halfline]
committed Details | Review
local-display-factory: track autologin displays (8.66 KB, patch)
2015-09-10 13:58 UTC, Ray Strode [halfline]
committed Details | Review
journalctl -b after autologin/logout/login (472.64 KB, text/plain)
2015-09-11 18:48 UTC, Federico Mena Quintero
  Details
manager: only claen up stub greeter display if it's actually a stub (4.58 KB, patch)
2015-09-14 14:31 UTC, Ray Strode [halfline]
committed Details | Review
display: don't complain if we dispose PREPARED display (3.15 KB, patch)
2015-09-14 14:53 UTC, Ray Strode [halfline]
committed Details | Review
local-display-factory: fix build for non-systemd systems (9.12 KB, patch)
2015-09-18 13:00 UTC, Ray Strode [halfline]
committed Details | Review
xorg.log from user session (14.55 KB, text/plain)
2015-10-17 14:32 UTC, Daniel Tobias
  Details

Description Daniel Tobias 2015-05-15 10:07:03 UTC
After enabling autologin for a user through gnome-control-center and restarting (I used "systemctl isolate rescue.target" & ctrl+D to contine) GDM autologs me into the desktop (as expected). 

But when I go to logout (Sytem menu -> username -> logout) I get switched to VT1 and just get left at a blank screen (with bootup messages etc.) GDM doesn't restart or is killed?
Comment 1 Daniel Tobias 2015-05-15 10:09:20 UTC
Without using autologin, I can login and out as expected
Comment 2 Daniel Tobias 2015-05-19 16:49:27 UTC
Created attachment 303611 [details]
snippet from journal

Hope this is an okay start, let me know what flags or packages I should rebuild with debugging etc. thanks
Comment 3 Pravin Satpute 2015-08-18 08:48:34 UTC
Any chance to get this fix soon?
Comment 4 Lukas Brabec 2015-08-18 08:57:25 UTC
We encountered same bug with gdm-3.17.4-1. This causes problem on our l10n testday -- user is not able to set localization using live image.

Steps to reproduce:
1. set autologin on (settings->users->unlock->autologin), or boot Fedora live [1]
2. logout

Expected results:
GDM with user selection is shown

Actual results:
Black screen with some boot info is shown.
The process gdm is still running.



[1]http://dl.fedoraproject.org/pub/alt/stage/23_Alpha_RC2/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-23_Alpha-2.iso
Comment 5 Kamil Páral 2015-08-18 10:07:28 UTC
Downstream report (there will be probably more duplicates around):
https://bugzilla.redhat.com/show_bug.cgi?id=1245953
Comment 6 Matthias Clasen 2015-08-21 20:02:30 UTC
putting this on the blocker list to keep it on the radar
Comment 7 Federico Mena Quintero 2015-09-07 19:22:59 UTC
For reference, here is "journalctl -b" from a no-autologin session (which logs out just fine) and an autologin session, which doesn't get back to the login screen properly.
Comment 8 Federico Mena Quintero 2015-09-07 19:23:58 UTC
Created attachment 310858 [details]
gdm-no-autologin.log
Comment 9 Federico Mena Quintero 2015-09-07 19:24:22 UTC
Created attachment 310859 [details]
gdm-autologin.log
Comment 10 Federico Mena Quintero 2015-09-08 22:28:02 UTC
Created attachment 310939 [details]
Annotated gdm-no-autologin.log

Grep for 'not appear' in the annotated log above.
Comment 11 Federico Mena Quintero 2015-09-08 22:28:52 UTC
Created attachment 310940 [details]
Annotated gdm-autologin.log
Comment 12 Federico Mena Quintero 2015-09-08 22:30:31 UTC
I've updated the attachments of the two logs, with some annotations.

Grep for 'not appear' in gdm-no-autologin.log:

* The no-autologin case switches back to VT-7 after logout, but the autologin case doesn't.

* There are these in gdm-no-autologin after switching back to VT-7, but no corresponding entries in the autologin case:

Sep 07 14:10:54 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[1393]: (II) systemd-logind: got resume for 226:0
Sep 07 14:10:54 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[1393]: (II) AIGLX: Resuming AIGLX clients after VT switch
Sep 07 14:10:54 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[1393]: (II) intel(0): switch to mode 1366x768@60.0 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection none
Sep 07 14:10:54 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[1393]: (II) systemd-logind: got resume for 13:69
Comment 13 Federico Mena Quintero 2015-09-08 22:36:41 UTC
The only thing that can cause the VT switch not to happen is in gdm/daemon/gdm-session-worker.c:gdm_session_worker_uninitialize_pam():

        if (worker->priv->login_vt != worker->priv->session_vt) {
                jump_to_vt (worker, worker->priv->login_vt);
        }
Comment 14 Federico Mena Quintero 2015-09-08 22:58:44 UTC
There is also a bunch of logging from gnome-session in the GsmSystemd domain that does not appear in the autologin case:

 Sep 07 14:10:41 taquito.chez-mppoy gnome-session[1421]: DEBUG(+): GsmSystemd: received logind signal: SessionNew
Comment 15 Federico Mena Quintero 2015-09-08 23:06:14 UTC
Created attachment 310942 [details]
Annotated gdm-no-autologin.log

This appears in no-autologin, but not in autologin:

Sep 07 13:36:28 taquito.chez-mppoy gnome-session[1421]: DEBUG(+): Using systemd for session tracking

There isn't the following in the autologin case, either:

Sep 07 14:10:41 taquito.chez-mppoy gnome-session[1421]: DEBUG(+): GsmSystemd: received logind signal: SessionNew

Which makes me think gnome-session isn't acknowledging systemd properly in the autologin case.
Comment 16 Ray Strode [halfline] 2015-09-09 12:11:50 UTC
sorry guys, i've been slow to look at this one. will take a look today.
Comment 17 Ray Strode [halfline] 2015-09-09 22:21:48 UTC
i'm still working on this but I know what's going on. it's not like a small introduced bug that can be bisected or anything like that. the code has to be reworked a bit. not too much, though.
Comment 18 Federico Mena Quintero 2015-09-10 00:15:22 UTC
Just to know, is this on gdm's side?  I'm as far as wanting to look why gnome-session doesn't systemd-ify itself:

GsmSystemd *
gsm_systemd_new (void)
{
        GsmSystemd *manager;

        /* logind is not running ? */
        if (access("/run/systemd/seats/", F_OK) < 0)
                return NULL;
Comment 19 Ray Strode [halfline] 2015-09-10 02:07:19 UTC
there could be two separate issues, but right now gdm doesn't have code written to start a login screen after log out from an autologin session.

it's definitely odd that /run/systemd/seats is failing though.  you need logind to even start the x server now, so if your getting into the session then logind must have worked at some point ...  maybe something is overmounting /run late in boot up.

does loginctl show the session?
Comment 20 Ray Strode [halfline] 2015-09-10 13:57:29 UTC
Created attachment 311075 [details] [review]
local-display-factory: spacing clean up

The function declaration for gdm_local_display_factory_sync_seats
put the return type on the same line as the function name. That
doesn't follow the GDM codebase's style.

This commit moves the return type to its own line.
Comment 21 Ray Strode [halfline] 2015-09-10 13:57:33 UTC
Created attachment 311076 [details] [review]
local-display-factory: call sync function after display finishes

Right now if a local display finishes we create a new one of the
same type to replace it.  But if a user display finishes we don't
want to create a new user display, we want to create greeter
display.  Furthermore if the user session is X11, we still want the
login screen that comes up to be wayland by default.

This commit changes the code to just call sync_seats after a display
finishes, since sync_seats is where the logic for where the login
screen display information is stored.

sync_seats is idempotent anyway, and will only create displays for
seats that need them, so it's safe to call it any time any local
display finishes.
Comment 22 Ray Strode [halfline] 2015-09-10 13:57:39 UTC
Created attachment 311077 [details] [review]
manager: don't muck with the session type and class of stub display (autologin)

Normally at startup a display is created of class "greeter" for the
login screen to use.  That display isn't used in the case automatic
login is enabled.  There's some iffy code to try to change the class
from "greeter" to "user" in the automatic login case.  That code is
wrong, because in the automatic login case a new display is created
specifically for the user session.  The greeter session is abandoned,
instead of used, so mucking with it's class and type is wrong.

This commit removes the code that does that mucking.
Comment 23 Ray Strode [halfline] 2015-09-10 13:57:44 UTC
Created attachment 311078 [details] [review]
manager: fix display leak

If we're doing autologin then we prepare a stub greeter display that
we don't actually end up using.  This commit makes sure the greeter
display gets cleaned up so it doesn't stick around in the display
store forever.
Comment 24 Ray Strode [halfline] 2015-09-10 13:57:57 UTC
Created attachment 311079 [details] [review]
manager: make sure user session displays have a seat assigned

The local display factory expects all displays it tracks to have
a seat, and we're going to be tracking automatic login displays
in the display factory in a subsequent commit.

This commit makes sure the seat-id is properly set on automatic
login display objects.
Comment 25 Ray Strode [halfline] 2015-09-10 13:58:02 UTC
Created attachment 311081 [details] [review]
local-display-factory: track autologin displays

At the moment the display-factory only tracks displays it adds itself.
autologin displays aren't added by the display-factory, but by the
manager.

This commit makes sure the display-factory is notified about the
autologin display, so when it finishes a login screen can be put in
its place.
Comment 26 Ray Strode [halfline] 2015-09-10 14:00:17 UTC
So the above commits fix it for the most part in Fedora.

One issue is I'm ending up with Xorg at the login screen instead of wayland after logout.  This is because gnome-shell-on-wayland crashes so gdm falls back.  I'll investigate that next, but wanted to post an update here.
Comment 27 Ray Strode [halfline] 2015-09-10 14:43:09 UTC
Attachment 311075 [details] pushed as 193046d - local-display-factory: spacing clean up
Attachment 311076 [details] pushed as 7247ee1 - local-display-factory: call sync function after display finishes
Attachment 311077 [details] pushed as fa9e98c - manager: don't muck with the session type and class of stub display (autologin)
Attachment 311078 [details] pushed as 2774c7e - manager: fix display leak
Attachment 311079 [details] pushed as 3499aab - manager: make sure user session displays have a seat assigned
Attachment 311081 [details] pushed as abb4685 - local-display-factory: track autologin displays

(leaving bug open until I figure out the story with the gnome-shell segfault, and until we resolve federico's logind registration problem)
Comment 28 Federico Mena Quintero 2015-09-11 18:48:02 UTC
Created attachment 311173 [details]
journalctl -b after autologin/logout/login

This is "journalctl -b" after autologin/logout/login

I get a text console, and these:

taquito:~$ loginctl list-sessions
   SESSION        UID USER             SEAT            
         1       1000 federico         seat0           
         3       1000 federico                         
         4       1000 federico         seat0           

3 sessions listed.

taquito:~$ loginctl session-status 4
4 - federico (1000)
           Since: Fri 2015-09-11 13:39:39 CDT; 7min ago
          Leader: 2386 (gdm-session-wor)
            Seat: seat0; vc2
             TTY: /dev/tty2
         Service: gdm-password; type x11; class user
           State: online
            Unit: session-4.scope
                  └─2386 gdm-session-worker [pam/gdm-password]

taquito:~$ ps auxwww | grep federi
federico   972  0.0  0.1  31844  4032 ?        Ss   13:23   0:00 /usr/lib/systemd/systemd --user
federico   977  0.0  0.0  63540  2236 ?        S    13:23   0:00 (sd-pam)
federico  1449  0.0  0.2 442328 10764 ?        S<l  13:24   0:00 /usr/bin/pulseaudio --start --log-target=syslog
federico  1478  0.0  0.1  81124  6740 ?        S    13:24   0:00 /usr/lib/pulse/gconf-helper
root      2063  0.0  0.1  91852  6412 ?        Ss   13:35   0:00 sshd: federico [priv]
federico  2065  0.0  0.0  91852  3608 ?        S    13:35   0:00 sshd: federico@pts/0
federico  2066  0.0  0.1  14868  4680 pts/0    Ss   13:35   0:00 -bash
federico  2571  100  0.0  26676  3080 pts/0    R+   13:47   0:00 ps auxwww
federico  2572  0.0  0.0  10508  1536 pts/0    S+   13:47   0:00 grep --color=auto federi
Comment 29 Ray Strode [halfline] 2015-09-14 14:31:01 UTC
Created attachment 311285 [details] [review]
manager: only claen up stub greeter display if it's actually a stub

commit 2774c7e43b9fdf5e5e59ef1f53ae7ba29f4aa23c fixed a leak in the
case we're doing autologin, but it also unconditionally cleans up
the display in the non-autologin case, too.

At the moment, we don't want to clean up the greeter in that case,
since it causes unnecessary flicker and slows down fast user switching.
( though this behavior may get changed again pending the outcome of
  bug 747339 )

This commit makes sure we only clean up the leaker greeter display, if
there is a leaked greeter display (namely, the autologin case)
Comment 30 Ray Strode [halfline] 2015-09-14 14:31:56 UTC
Comment on attachment 311285 [details] [review]
manager: only claen up stub greeter display if it's actually a stub

Attachment 311285 [details] pushed as 6b15680 - manager: only claen up stub greeter display if it's actually a stub
Comment 31 Ray Strode [halfline] 2015-09-14 14:53:23 UTC
Created attachment 311290 [details] [review]
display: don't complain if we dispose PREPARED display

It's expected now that we may dispose a display when it's
prepared (if it was prepared but then we determined we were
going to autologin instead).
Comment 32 Ray Strode [halfline] 2015-09-14 14:54:19 UTC
Comment on attachment 311290 [details] [review]
display: don't complain if we dispose PREPARED display

Attachment 311290 [details] pushed as 1f6ae5f - display: don't complain if we dispose PREPARED display
Comment 33 Ray Strode [halfline] 2015-09-14 15:04:05 UTC
Federico, can you try adding attachment 311285 [details] [review] to your list of backports?  I accidentally cleaned up non-autologin displays, too, which was causing the greeter X server to exit at the same time your user session was starting up. X really hates getting started or stopped on an inactive VT and I think it was what was leading to the failure. you can see some of the anger here:

Sep 11 13:39:39 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[2170]: (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
Sep 11 13:39:39 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[2170]: (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
Sep 11 13:39:39 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[2170]: (WW) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
Sep 11 13:39:39 taquito.chez-mppoy /usr/lib/gdm/gdm-x-session[2170]: (WW) xf86CloseConsole: VT_WAITACTIVE failed: Input/output error

I do see your logind registration issues apparently resolved themselves:

Sep 11 13:35:37 taquito.chez-mppoy gnome-session[2178]: WARNING: Using systemd for session tracking

If things are still broken with latest master i'll probably push a few commits that flesh out the logging a bit, so we can get a clearer picture of why it's failing.
Comment 34 Federico Mena Quintero 2015-09-14 20:52:15 UTC
(In reply to Ray Strode [halfline] from comment #33)
> Federico, can you try adding attachment 311285 [details] [review] [review] to your
> list of backports?

This seems to work great; thanks a lot!!!  I can now log out and log back in just fine.

After logging in again, loginctl still says that the original session is closing, but that's pulseaudio and that pesky pulse/gconf-helper thing.

> I do see your logind registration issues apparently resolved themselves:
> 
> Sep 11 13:35:37 taquito.chez-mppoy gnome-session[2178]: WARNING: Using
> systemd for session tracking

Heh, that's a hacked gnome-session.  I modified it to g_warning() instead of g_debug() when starting the GsmSystemd object, because I was too lazy to figure out how to pass extra environment variables to startup programs (G_MESSAGES_DEBUG or whatever it is to make g_debug() messages show up by default) :)
Comment 35 Ray Strode [halfline] 2015-09-14 21:11:13 UTC
(In reply to Federico Mena Quintero from comment #34) 
> This seems to work great; thanks a lot!!!  I can now log out and log back in
> just fine.
Great.

> After logging in again, loginctl still says that the original session is
> closing, but that's pulseaudio and that pesky pulse/gconf-helper thing.
Yea I think that's "normal". pulseaudio sticks around 30 secs or something like that. As long as it's "closing" and not "active" or "online" we're fine.

> Heh, that's a hacked gnome-session.
Yea figured, but it did make it clear your issues went away (though still not clearly why they were happening)
Comment 36 Daniel Tobias 2015-09-14 21:15:33 UTC
Is any of this likely to be backported to 3.16 or is it considered EOL now?
Comment 37 Ray Strode [halfline] 2015-09-14 21:18:51 UTC
As I understand it Federico already backported it. Federico, mind pushing your backport to the gnome-3-16 branch? I can do a 3.16.3 release.
Comment 38 Federico Mena Quintero 2015-09-15 17:23:21 UTC
Yes, no problem; I'll push this to the 3.16 branch.
Comment 39 Federico Mena Quintero 2015-09-15 21:05:49 UTC
Pushed to the gnome-3-16 branch!  The last commit is 68332491d40380dcfc20ea2eb63669fa2f575117.

Thanks to Ray for his top-notch work, as always.
Comment 40 Antoine Jacoutot 2015-09-17 18:13:55 UTC
This commit breaks compiling GDM on non-systemd systems because gdm_local_display_factory_sync_seats if part of #ifdef WITH_SYSTEMD:
https://git.gnome.org/browse/gdm/commit/?h=gnome-3-16&id=78f91789926affd42b159bd7cb037e5dd584e356

libtool: link: cc -o gdm -pthread -O2 -pipe -fPIC main.o gdm-display-access-file.o gdm-display-store.o gdm-display-factory.o gdm-local-display-factory.o gdm-display.o gdm-legacy-display.o gdm-local-display.o gdm-launch-environment.o gdm-manager.o gdm-server.o gdm-session.o gdm-session-record.o gdm-session-worker-common.o gdm-session-worker-job.o gdm-dbus-util.o gdm-xerrors.o gdm-xdmcp-display-factory.o gdm-xdmcp-display.o gdm-xdmcp-chooser-display.o gdm-display-glue.o gdm-local-display-factory-glue.o gdm-manager-glue.o gdm-local-display-glue.o gdm-session-glue.o gdm-session-worker-glue.o gdm-session-enum-types.o /usr/ports/pobj/gdm-3.16.3/gdm-3.16.3/common/.libs/libgdmcommon.a -L.libs -lX11 -lxcb -lXau -lgio-2.0 -lgobject-2.0 -lglib-2.0 -liconv -lpcre -lintl -lffi -lgmodule-2.0 -lz -laccountsservice -lXdmcp -lutil -Wl,-rpath-link,/usr/X11R6/lib,-rpath-link,/usr/local/lib
gdm-xdmcp-display-factory.o: In function `gdm_xdmcp_display_factory_init':
gdm-display.o: In function `gdm_display_connect':
gdm-local-display-factory.o: In function `on_display_status_changed':
gdm-local-display-factory.c:(.text+0x8b7): undefined reference to `gdm_local_display_factory_sync_seats'
Comment 41 Ray Strode [halfline] 2015-09-17 18:46:25 UTC
can you push a build fix to the gnome-3-16 branch and i'll do another release ?
Comment 42 Antoine Jacoutot 2015-09-18 07:45:28 UTC
(In reply to Ray Strode [halfline] from comment #41)
> can you push a build fix to the gnome-3-16 branch and i'll do another
> release ?

Not sure what to do.
Should gdm_local_display_factory_sync_seats() be used in the systemd case and create_display() in the non-systemd one?
Comment 43 Ray Strode [halfline] 2015-09-18 13:00:47 UTC
Created attachment 311635 [details] [review]
local-display-factory: fix build for non-systemd systems

commit 78f91789926affd42b159bd7cb037e5dd584e356 switched to
calling gdm_local_display_factory_sync_seats() unconditionally
after a display goes away, instead of create_display.

This breaks non-systemd systems since that function only exists
on systemd systems.

This commit fixes the build by moving the entire logic (both
systemd and consolekit) from gdm_local_display_factory_start to
a helper function and using the helper function instead.
Comment 44 Ray Strode [halfline] 2015-09-18 13:01:45 UTC
↑  does this work?  ↑
Comment 45 Antoine Jacoutot 2015-09-18 13:36:34 UTC
(In reply to Ray Strode [halfline] from comment #44)
> ↑  does this work?  ↑

Yup, it builds fine now.
Thanks Ray! :-)
Comment 46 Ray Strode [halfline] 2015-09-18 19:33:52 UTC
Attachment 311635 [details] pushed as 267da3e - local-display-factory: fix build for non-systemd systems
Comment 47 Kamil Páral 2015-10-07 12:55:05 UTC
Ray, in which gdm version is this expected to be fixed? gdm-3.18.0-1.fc23.x86_64 doesn't seem to contain it. It would be nice to see fix landing before Fedora 23 RC is composed, otherwise it's not possible to change language on a Live image. The Fedora report is:
https://bugzilla.redhat.com/show_bug.cgi?id=1245953
Comment 48 Daniel Tobias 2015-10-17 14:24:13 UTC
Recently moved up to gnome 3.18 and noticed that I can no longer login at all when EnableWayland=False is commented (wayland enabled for gdm). After entering password, the screen flickers and I'm back at the login screen. tried scrolling vt's and couldn't find my session anywhere. When using gdm in xorg mode everything works okay. May not be related, but I'll start here just in case.
Comment 49 Daniel Tobias 2015-10-17 14:32:51 UTC
Created attachment 313538 [details]
xorg.log from user session

it looks like a problem with intel, sorry for the noise