GNOME Bugzilla – Bug 749418
GDM autologin breaks logout
Last modified: 2015-10-17 14:33:07 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?
Without using autologin, I can login and out as expected
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
Any chance to get this fix soon?
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
Downstream report (there will be probably more duplicates around): https://bugzilla.redhat.com/show_bug.cgi?id=1245953
putting this on the blocker list to keep it on the radar
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.
Created attachment 310858 [details] gdm-no-autologin.log
Created attachment 310859 [details] gdm-autologin.log
Created attachment 310939 [details] Annotated gdm-no-autologin.log Grep for 'not appear' in the annotated log above.
Created attachment 310940 [details] Annotated gdm-autologin.log
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
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); }
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
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.
sorry guys, i've been slow to look at this one. will take a look today.
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.
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;
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?
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.
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.
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.
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.
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.
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.
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.
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)
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
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 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
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 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
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.
(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) :)
(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)
Is any of this likely to be backported to 3.16 or is it considered EOL now?
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.
Yes, no problem; I'll push this to the 3.16 branch.
Pushed to the gnome-3-16 branch! The last commit is 68332491d40380dcfc20ea2eb63669fa2f575117. Thanks to Ray for his top-notch work, as always.
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'
can you push a build fix to the gnome-3-16 branch and i'll do another release ?
(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?
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.
↑ does this work? ↑
(In reply to Ray Strode [halfline] from comment #44) > ↑ does this work? ↑ Yup, it builds fine now. Thanks Ray! :-)
Attachment 311635 [details] pushed as 267da3e - local-display-factory: fix build for non-systemd systems
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
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.
Created attachment 313538 [details] xorg.log from user session it looks like a problem with intel, sorry for the noise