Bug 467547

Summary: Logging out of Plasma 5.27.3 on Wayland resulted in a black screen
Product: [Plasma] ksmserver Reporter: Matt Fagnani <matt.fagnani>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED UPSTREAM    
Severity: normal CC: fabian, kparal, nate, plasma-bugs, postix, z273ap4t
Priority: NOR    
Version: 5.27.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
URL: https://github.com/sddm/sddm/pull/1701
Latest Commit: Version Fixed In: SDDM 0.20
Attachments: Journal for boot of Fedora-KDE-Live-x86_64-38-20230318.n.0.iso in a QEMU/KVM VM in GNOME Boxes in which the black screen happened 3 times

Description Matt Fagnani 2023-03-18 23:01:03 UTC
Created attachment 157405 [details]
Journal for boot of Fedora-KDE-Live-x86_64-38-20230318.n.0.iso in a QEMU/KVM VM in GNOME Boxes in which the black screen happened 3 times

SUMMARY

I'm using a Fedora 38 KDE Plasma installation with two users. I logged in to Plasma 5.27.3 on Wayland as the second user, and then I logged out of Plasma. The system just showed a black screen with a blinking text cursor at the top-left of the screen. I switched to another VT and logged in. systemctl status sddm showed that sddm was running while the black screen happened. I ran sudo systemctl restart sddm which showed sddm on Wayland with the kwin_wayland compositor. This problem didn't happen when I logged in as the first user and logged out.

I reproduced this problem using Fedora-KDE-Live-x86_64-38-20230318.n.0.iso in a QEMU/KVM VM in GNOME Boxes. I created a second user in System Settings in Plasma 5.27.3 on Wayland. I logged out and logged in as the second user. I logged out as the second user. The journal showed that dbus-:1.2-org.kde.LogoutPrompt@0.service failed and kwin_wayland_wrapper had an error (EE) failed to read Wayland events: Broken pipe. Various KDE programs had errors like The Wayland connection broke. Did the Wayland compositor die? kwin_wayland might've stopped before the other KDE programs leading to those errors.

Mar 18 17:46:48 systemd[2832]: Started dbus-:1.2-org.kde.LogoutPrompt@0.service.
Mar 18 17:46:49 ksmserver-logout-greeter[4260]: libEGL warning: egl: failed to create dri2 screen
Mar 18 17:46:49 kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Mar 18 17:46:49 kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Mar 18 17:46:49 kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Mar 18 17:46:49 ksmserver-logout-greeter[4260]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Mar 18 17:46:49 ksmserver-logout-greeter[4260]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Mar 18 17:46:51 systemd[2832]: Started dbus-:1.2-org.kde.Shutdown@0.service.
Mar 18 17:46:51 systemd[2832]: dbus-:1.2-org.kde.LogoutPrompt@0.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:51 systemd[2832]: dbus-:1.2-org.kde.LogoutPrompt@0.service: Failed with result 'exit-code'.
Mar 18 17:46:51 systemd[2832]: dbus-:1.2-org.kde.LogoutPrompt@0.service: Consumed 1.976s CPU time.
Mar 18 17:46:52 kwin_wayland_wrapper[2982]: (EE) failed to read Wayland events: Broken pipe
Mar 18 17:46:52 kded5[3076]: X connection to :0 broken (explicit kill or server shutdown).
Mar 18 17:46:52 kaccess[3353]: The X11 connection broke (error 1). Did the X11 server die?
Mar 18 17:46:52 systemd[2832]: app-kaccess@autostart.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: app-kaccess@autostart.service: Failed with result 'exit-code'.
Mar 18 17:46:52 kwin_wayland[2910]: QtDBus: cannot relay signals from parent QObject(0x561525cd4740 "") unless they are emitted in the object's thread QThread(0x561525bd5cb8 "libinput-connection"). Current thread is QThread(0x561525b95790 "").
Mar 18 17:46:52 imsettings-daemon[3367]: [        52.190749]: IMSettings-Daemon[3367]: INFO: Stopped main process for IBus with the status 0 [pid: 3647]
Mar 18 17:46:52 kwalletd5[2855]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 kded5[3004]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 kactivitymanagerd[3036]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 DiscoverNotifier[3355]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_control[3646]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 kded5[3004]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 polkit-kde-authentication-agent-1[3096]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 kdeconnectd[3341]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 xdg-desktop-por[3171]: Lost connection to Wayland compositor.
Mar 18 17:46:52 xdg-desktop-portal-kde[3099]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_sendlater_agent[3862]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_followupreminder_agent[3871]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 plasmashell[3037]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 kalendarac[3358]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_migration_agent[3869]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_mailfilter_agent[3859]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_ical_resource[4180]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_archivemail_agent[3874]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_akonotes_resource[4197]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_contacts_resource[4143]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 org_kde_powerdevil[3097]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 systemd[2832]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: plasma-xdg-desktop-portal-kde.service: Failed with result 'exit-code'.
Mar 18 17:46:52 akonadi_contacts_resource[4143]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 systemd[2832]: plasma-kactivitymanagerd.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: plasma-kactivitymanagerd.service: Failed with result 'exit-code'.
Mar 18 17:46:52 akonadi_indexing_agent[3873]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_mailmerge_agent[3868]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_birthdays_resource[3883]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_unifiedmailbox_agent[3872]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_newmailnotifier_agent[3875]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 systemd[2832]: plasma-polkit-agent.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 akonadi_indexing_agent[3873]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 systemd[2832]: plasma-polkit-agent.service: Failed with result 'exit-code'.
Mar 18 17:46:52 akonadi_maildir_resource[4085]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 akonadi_mailmerge_agent[3868]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 systemd[2832]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Mar 18 17:46:52 akonadiserver[3750]: org.kde.pim.akonadiserver: Subscriber "AgentBaseChangeRecorder - 94521374331440" disconnected
Mar 18 17:46:52 systemd[2832]: plasma-kded.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: plasma-kded.service: Failed with result 'exit-code'.
Mar 18 17:46:52 systemd[2832]: plasma-kded.service: Consumed 2.695s CPU time.
Mar 18 17:46:52 akonadiserver[3750]: org.kde.pim.akonadiserver: Subscriber "AgentBaseChangeRecorder - 93876285905392" disconnected
Mar 18 17:46:52 akonadiserver[3750]: org.kde.pim.akonadiserver: Subscriber "AgentBaseChangeRecorder - 94562859011440" disconnected
Mar 18 17:46:52 akonadiserver[3750]: org.kde.pim.akonadiserver: Subscriber "AgentBaseChangeRecorder - 93941736334592" disconnected
Mar 18 17:46:52 akonadiserver[3750]: org.kde.pim.akonadiserver: Subscriber "AgentBaseChangeRecorder - 93848135508064" disconnected
Mar 18 17:46:52 polkitd[1072]: Unregistered Authentication Agent for unix-session:4 (system bus name :1.128, object path /org/kde/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Mar 18 17:46:52 systemd[2832]: plasma-powerdevil.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: plasma-powerdevil.service: Failed with result 'exit-code'.
Mar 18 17:46:52 systemd[2832]: app-org.kde.kdeconnect.daemon@autostart.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: app-org.kde.kdeconnect.daemon@autostart.service: Failed with result 'exit-code'.
Mar 18 17:46:52 systemd[2832]: app-org.kde.kdeconnect.daemon@autostart.service: Consumed 1.167s CPU time.
Mar 18 17:46:52 akonadiserver[3750]: org.kde.pim.akonadiserver: Subscriber "AgentBaseChangeRecorder - 94567479754624" disconnected
Mar 18 17:46:52 systemd[2832]: Stopped target plasma-workspace-wayland.target.
Mar 18 17:46:52 systemd[2832]: plasma-kwin_wayland.service: Consumed 36.530s CPU time.
Mar 18 17:46:52 systemd[2832]: Stopped target plasma-workspace.target - KDE Plasma Workspace.
Mar 18 17:46:52 akonadi_maildispatcher_agent[3870]: The Wayland connection broke. Did the Wayland compositor die?
Mar 18 17:46:52 systemd[2832]: Stopped target xdg-desktop-autostart.target - Startup of XDG autostart applications.
Mar 18 17:46:52 systemd[2832]: Stopping app-geoclue\x2ddemo\x2dagent@autostart.service - Geoclue Demo agent...
Mar 18 17:46:52 systemd[2832]: Stopping app-org.freedesktop.problems.applet@autostart.service - Problem Reporting...
Mar 18 17:46:52 systemd[2832]: Stopping app-org.kde.discover.notifier@autostart.service - Discover...
Mar 18 17:46:52 systemd[2832]: Stopping app-org.kde.kalendarac@autostart.service - Calendar Reminders...
Mar 18 17:46:52 dbus-broker[3215]: Dispatched 68 messages @ 41(±159)μs / message.
Mar 18 17:46:52 systemd[2832]: Stopping at-spi-dbus-bus.service - Accessibility services bus...
Mar 18 17:46:52 systemd[2832]: Stopped plasma-polkit-agent.service - KDE PolicyKit Authentication Agent.
Mar 18 17:46:52 systemd[2832]: Stopped plasma-powerdevil.service - Powerdevil.
Mar 18 17:46:52 systemd[2832]: Stopped target plasma-core.target - KDE Plasma Workspace Core.
Mar 18 17:46:52 systemd[2832]: Stopping plasma-plasmashell.service - KDE Plasma Workspace...
Mar 18 17:46:52 systemd[2832]: Stopping xdg-desktop-portal.service - Portal service...
Mar 18 17:46:52 systemd[2832]: Stopping xdg-document-portal.service - flatpak document portal service...
Mar 18 17:46:52 systemd[2832]: Stopping xdg-permission-store.service - sandboxed app permission store...
Mar 18 17:46:52 systemd[2832]: Stopped xdg-desktop-portal.service - Portal service.
Mar 18 17:46:52 systemd[2832]: Stopped xdg-permission-store.service - sandboxed app permission store.
Mar 18 17:46:52 systemd[1]: run-user-1001-doc.mount: Deactivated successfully.
Mar 18 17:46:52 systemd[2832]: plasma-plasmashell.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: plasma-plasmashell.service: Failed with result 'exit-code'.
Mar 18 17:46:52 systemd[2832]: Stopped plasma-plasmashell.service - KDE Plasma Workspace.
Mar 18 17:46:52 systemd[2832]: plasma-plasmashell.service: Consumed 28.081s CPU time.
Mar 18 17:46:52 systemd[2832]: Stopped at-spi-dbus-bus.service - Accessibility services bus.
Mar 18 17:46:52 systemd[2832]: Stopped app-org.freedesktop.problems.applet@autostart.service - Problem Reporting.
Mar 18 17:46:52 systemd[2832]: Stopped app-geoclue\x2ddemo\x2dagent@autostart.service - Geoclue Demo agent.
Mar 18 17:46:52 systemd[2832]: app-org.kde.discover.notifier@autostart.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: app-org.kde.discover.notifier@autostart.service: Failed with result 'exit-code'.
Mar 18 17:46:52 systemd[2832]: Stopped app-org.kde.discover.notifier@autostart.service - Discover.
Mar 18 17:46:52 systemd[2832]: app-org.kde.kalendarac@autostart.service: Main process exited, code=exited, status=1/FAILURE
Mar 18 17:46:52 systemd[2832]: Stopped xdg-document-portal.service - flatpak document portal service.
Mar 18 17:46:52 systemd[2832]: app-org.kde.kalendarac@autostart.service: Failed with result 'exit-code'.
Mar 18 17:46:52 systemd[2832]: Stopped app-org.kde.kalendarac@autostart.service - Calendar Reminders.
Mar 18 17:46:52 systemd[2832]: app-org.kde.kalendarac@autostart.service: Consumed 18.749s CPU time.
Mar 18 17:46:52 systemd[2832]: Stopped target graphical-session.target - Current graphical user session.
Mar 18 17:46:52 systemd[2832]: Stopped target graphical-session-pre.target - Session services which should run early before the graphical session is brought up.
Mar 18 17:46:52 systemd[2832]: Stopping uresourced.service - User resource assignment daemon...
Mar 18 17:46:52 systemd[2832]: Stopped uresourced.service - User resource assignment daemon.
Mar 18 17:47:24 spice-vdagentd[1431]: Error getting active session: No data available
Mar 18 17:47:24 spice-vdagentd[1431]: Error getting active session: No data available

coredumpctl didn't show crashes for the logouts when the black screen problem happened. The black screen happened 3/3 times when logging out as the second user from the Fedora 38 installation and 3/3 times when logging out as the second user in the VM. I'm attaching the journal of the boot of the VM in which the problem happened 3 times.

STEPS TO REPRODUCE
1. Boot a Fedora 38 KDE Plasma installation updated to 2023-3-18 with updates-testing enabled with two users 
2. Log in to Plasma on Wayland as the second user from sddm on Wayland
3. Log out of Plasma

OBSERVED RESULT
Logging out of Plasma 5.27.3 on Wayland as the second user on the system resulted in a black screen

EXPECTED RESULT
sddm would be shown instead of a black screen when logging out as the second user

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 38
(available in About System)
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Matt Fagnani 2023-03-19 02:12:29 UTC
I reproduced the black screen problem when logging out as the second user in my Fedora 38 installation. loginctl in the VT showed that the second user's session was still active and there wasn't a sddm session. The problem might involve the second user's session not being properly stopped so that the sddm session never started. The errors I reported might have prevented the second user's session from stopping. xdg-desktop-portal-kde crashes when run by sddm happened as at https://bugzilla.redhat.com/show_bug.cgi?id=2129479 when I logged out as the first user and the black screen didn't happen.
Comment 2 Fabian Vogt 2023-03-20 11:40:55 UTC
Bug in SDDM, fixed upstream: https://github.com/sddm/sddm/issues/1660
Comment 3 Matt Fagnani 2023-03-20 20:02:46 UTC
(In reply to Fabian Vogt from comment #2)
> Bug in SDDM, fixed upstream: https://github.com/sddm/sddm/issues/1660

This problem still happened after I updated to sddm-0.19.0^git20230320.e07e805-2.fc38 https://koji.fedoraproject.org/koji/buildinfo?buildID=2172984 in my Fedora 38 KDE Plasma installation, rebooted twice, then logged in as the second user and logged out. 
sddm-0.19.0^git20230320.e07e805-2.fc38 appears to have the commit https://github.com/sddm/sddm/commit/e07e805c21310572b4fecc810fd5610b1d3d03fd which was marked as fixing https://github.com/sddm/sddm/issues/1660 for the user switching problem. This logout problem might be different from that one and might not be fixed yet.
Comment 4 Matt Fagnani 2023-03-21 04:20:56 UTC
I was logged in as only one user when the black screen problem happened during logout. I wasn't switching users which was disabled as an option from the Leave menu of the Application Launcher menu in Fedora 38 due to the problem at https://bugs.kde.org/show_bug.cgi?id=466118 The second users on the installation and VM had the standard account type in System Settings' User page. The first users had the administrator account type in System Settings' User page and were in the wheel group.
Comment 5 Kamil Paral 2023-03-30 12:15:36 UTC
Reopening this bug, it's still not fixed. The downstream Fedora bug contains backtraces of the live sddm processes when this issue happens. Please see https://bugzilla.redhat.com/show_bug.cgi?id=2179591#c34 and below. Thanks.
Comment 6 Fabian Vogt 2023-03-30 14:08:42 UTC
> This logout problem might be different from that one and might not be fixed yet.

Yeah, looks like it :-/

(In reply to Kamil Paral from comment #5)
> Reopening this bug, it's still not fixed. The downstream Fedora bug contains
> backtraces of the live sddm processes when this issue happens. Please see
> https://bugzilla.redhat.com/show_bug.cgi?id=2179591#c34 and below. Thanks.

Ok. What I see is that sddm-helper sent the SESSION_STATUS command to the daemon and waits for the reply. The daemon is idle in the event loop though.
Comment 7 Matt Fagnani 2023-04-01 03:26:41 UTC
If the user's session isn't stopped properly due to the failure of dbus-:1.2-org.kde.LogoutPrompt which runs /usr/libexec/ksmserver-logout-greeter from /usr/share/dbus-1/services/org.kde.LogoutPrompt.service, then the sddm session might not be started and sddm might be left waiting indefinitely, I'm reassigning this report to ksmserver due to that error and the failure of the user session to stop and the sddm session to start. This black screen problem happened most of the time I've logged out as the second and third users which were of the standard account type in my Fedora 38 installation. A race condition might be involved. This problem was accepted as a Fedora 38 Final blocker https://bugzilla.redhat.com/show_bug.cgi?id=2179591#c23
Comment 8 Fabian Vogt 2023-04-04 14:45:44 UTC
By pure chance I tried pam_lastlog2 with sddm today and that's the first time I actually ran into the issue. That was not just a coincidence - it was the "Last login: ..." message which triggers the race condition. Previously, we didn't have any PAM module printing such a message active, so sddm-helper did not end up triggering the race condition in sddm.

Please try https://github.com/sddm/sddm/pull/1701.
Comment 9 Matt Fagnani 2023-04-04 17:13:12 UTC
I updated to sddm-0.19.0^git20230403.67b8e4c-1.fc38.x86_64 https://bugzilla.redhat.com/show_bug.cgi?id=2179591#c39 to test the new patch. Logout of Plasma as the second user on the system happened normally 8/8 times. The black screen problem didn't happen. The user's session stopped and the sddm session started. The dbus-:1.2-org.kde.LogoutPrompt@0.service failures and other errors were still shown in the journal. Thanks.
Comment 10 Fabian Vogt 2023-04-04 18:33:36 UTC
Yay! Closing as fixed upstream.
Comment 11 Nate Graham 2023-04-13 19:51:47 UTC
*** Bug 468464 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2023-10-11 17:19:33 UTC
*** Bug 474832 has been marked as a duplicate of this bug. ***