Bug 445449 - Shutting down from Plasma Wayland causes shutdown to be delayed while stopping SDDM
Summary: Shutting down from Plasma Wayland causes shutdown to be delayed while stoppin...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.23.3
Platform: Archlinux Linux
: NOR normal with 5 votes (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL: https://github.com/sddm/sddm/issues/1476
Keywords: wayland
: 445385 451065 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-11-13 23:46 UTC by Jon Voss
Modified: 2022-11-09 06:35 UTC (History)
22 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
picture of issue (1.01 MB, image/jpeg)
2021-11-13 23:46 UTC, Jon Voss
Details
tail of journal where issue occurred (3.05 KB, text/plain)
2021-11-13 23:47 UTC, Jon Voss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Voss 2021-11-13 23:46:49 UTC
Created attachment 143523 [details]
picture of issue

SUMMARY
When issuing a shutdown or restart from within a Plasma Wayland session, there is a 1 min. 30 sec. delay while waiting for systemd to stop Simple Desktop Display Manager. This times out and forces a SIGKILL to sddm and associated processes.

If I log out of my session and shutdown/reboot directly from sddm, this issue does not occur. Shutdown is instantaneous.

I cannot reproduce in the X11 session. It only occurs in Wayland. It also did not occur prior to 5.23.3.
A relevant portion of my shutdown log is attached. Not much to see, unfortunately.

Let me know if I can help in any way.

STEPS TO REPRODUCE
1. Log in to Plasma Wayland
2. Applcation Launcher -> Shutdown (or Restart)

OBSERVED RESULT
Shutdown hangs on SDDM.

EXPECTED RESULT
Shutdown should be instantaneous.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.15.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT

ADDITIONAL INFORMATION

Does this fix?
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1177
Comment 1 Jon Voss 2021-11-13 23:47:29 UTC
Created attachment 143524 [details]
tail of journal where issue occurred
Comment 2 Schlaefer 2021-11-14 11:37:00 UTC
> SUMMARY
> When issuing a shutdown or restart from within a Plasma Wayland session,
> there is a 1 min. 30 sec. delay while waiting for systemd to stop Simple
> Desktop Display Manager. This times out and forces a SIGKILL to sddm and
> associated processes.

Same here.

The issue started using the 15.15 kernel. Check with 5.10-LTS seems fine.

Just switching to a new session (strg+alt+F-key) and back immediately successfully stops SDDM.

Operating System: EndeavourOS
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.2-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon RX 5500 XT
Comment 3 Jon Voss 2021-11-14 14:59:08 UTC
(In reply to Schlaefer from comment #2)
> > SUMMARY
> > When issuing a shutdown or restart from within a Plasma Wayland session,
> > there is a 1 min. 30 sec. delay while waiting for systemd to stop Simple
> > Desktop Display Manager. This times out and forces a SIGKILL to sddm and
> > associated processes.
> 
> Same here.
> 
> The issue started using the 15.15 kernel. Check with 5.10-LTS seems fine.
> 

Confirmed. I downgraded to kernel 5.14.16 and the issue went away. Shutdown is immediate.
Comment 4 asvqmnmd 2021-11-14 17:28:42 UTC
I am having the same issue with xorg - https://bugs.kde.org/show_bug.cgi?id=445385
Comment 6 Aleix Pol 2021-11-23 23:17:48 UTC
Would you be able to test git master there? f377696bff39e35ae0f7ae6104d8732b3856744e could help address this issue.

Otherwise, could you try enabling systemd boot for Plasma and see if it addresses the problem for you?
https://invent.kde.org/plasma/plasma-workspace/-/wikis/Plasma-and-the-systemd-boot
Comment 7 Nate Graham 2021-11-24 19:32:25 UTC
.
Comment 8 asvqmnmd 2021-11-25 08:09:54 UTC
(In reply to Aleix Pol from comment #6)
> Would you be able to test git master there?
> f377696bff39e35ae0f7ae6104d8732b3856744e could help address this issue.
> 
> Otherwise, could you try enabling systemd boot for Plasma and see if it
> addresses the problem for you?
> https://invent.kde.org/plasma/plasma-workspace/-/wikis/Plasma-and-the-
> systemd-boot

I am facing the same problem as I mentioned in my bug - https://bugs.kde.org/show_bug.cgi?id=445385
 This is my shutdown log - http://ix.io/3G3o
Comment 9 asvqmnmd 2021-11-25 08:51:02 UTC
People having the same issue here I think it is a sddm issue or a kwin issue - https://bbs.archlinux.org/viewtopic.php?id=259577
Comment 10 Jon Voss 2021-11-27 05:38:07 UTC
(In reply to Aleix Pol from comment #6)
> Would you be able to test git master there?
> f377696bff39e35ae0f7ae6104d8732b3856744e could help address this issue.
> 
> Otherwise, could you try enabling systemd boot for Plasma and see if it
> addresses the problem for you?
> https://invent.kde.org/plasma/plasma-workspace/-/wikis/Plasma-and-the-
> systemd-boot

Using systemd boot for the session doesn't fix. Will that MR be included in 5.23.4? If so, I will let you know if it resolves when it hits the repo next week.
Comment 11 Jon Voss 2021-11-30 17:38:23 UTC
Reporting back that 5.23.4 does not fix the issue.
Comment 12 asvqmnmd 2021-12-03 16:03:54 UTC
(In reply to Jon Voss from comment #11)
> Reporting back that 5.23.4 does not fix the issue.

I think it is a kwin (compositor bug). Systemd is not able to kill kwin. Thats why it takes time to shutdown.
Comment 13 Alberto 2021-12-04 09:18:49 UTC
With another display manager there is no delay in shutdown.
The problem is caused by SDDM,
Comment 14 asvqmnmd 2021-12-04 19:40:08 UTC
(In reply to Alberto from comment #13)
> With another display manager there is no delay in shutdown.
> The problem is caused by SDDM,

Anyways I fixed my problem. I am using cinnamon with sddm. I completely removed kde and it works fine. Kde has a lot of bugs and they don't fix it so I switched to cinnamon and it works like a charm. The best way to fix a problem is to file a bug report and if they don't fix it just simply move to a new display manager or a new desktop environment.
Comment 15 asvqmnmd 2021-12-04 19:47:35 UTC
Cinaamon is much better than plasma and they have dont have serious bugs like kde. Cinnamon is a bit ugly but u can change it if u want.
Comment 16 asvqmnmd 2021-12-04 19:49:00 UTC
Don't have *
Comment 17 BEEDELL ROKE JULIAN LOCKHART 2021-12-11 19:47:04 UTC
For me, this problem was present during approximately two months before 2021-12-11, whcih was when I was utilising Manjaro KDE, and subsequently Rawhide of Fedora Kinoite, and subsequently Rawhide of Fedora KDE Plasma Desktop. This problem did not affect my subsequent and recent installation of Debian 12, although my lack of utilisation of that installation may have been why it did not affect it. Additionally, this problem has not affected my current installation of Rawhide of Fedora KDE Plasma Desktop by version of the installer of Fedora Server that had been submitted from Rawhide. I have not manually installed new drivers since my current installation of Fedora KDE Plasma Desktop, and I have extensively utilised this computer. Consequently, is anybody that is utilising the most new version of their distribution able to verify that this is occurring for them?
Comment 18 Alberto 2021-12-12 09:39:09 UTC
This bug is also in OpenSuse Tumbleweed
Comment 19 Jon Voss 2021-12-13 13:57:57 UTC
I was able to compile git master and it appears this may be fixed there. I haven't tested extensively, but a couple of reboots didn't hang.
Comment 20 Vlad Zahorodnii 2021-12-13 14:49:58 UTC
From my quick debugging session, it appears like sddm is stopped, but then sddm restarts for some unknown reason.
Comment 21 winblocker 2022-01-06 20:54:21 UTC
Tested on OpenSuse Tumbleweed Krypton (Git) on January 2nd and the problem still is present. The timer can be worked around when the keys for the session are pressed (ctrl + f7 OpenSuse / ctrl + f1 arch).
Comment 22 Vlad Zahorodnii 2022-01-10 09:26:39 UTC
Can somebody report this issue to SDDM developers? SDDM stops X11 and then restarts it for some reason, which causes a hang. kwin_wayland is gone by that time.
Comment 23 Vlad Zahorodnii 2022-01-18 10:24:47 UTC
FTR, with wayland greeter, I can't reproduce the issue. As a workaround you could use

[General]
DisplayServer=wayland

[Wayland]
CompositorCommand=weston --shell=fullscreen-shell.so
EnableHiDPI=true

make sure that you have weston installed, you could also use kwin_wayland
Comment 24 Aleix Pol 2022-01-18 16:34:05 UTC
Here's the issue in SDDM: https://github.com/sddm/sddm/issues/1476
Comment 25 Nate Graham 2022-03-21 23:41:58 UTC
*** Bug 445385 has been marked as a duplicate of this bug. ***
Comment 26 Nate Graham 2022-03-21 23:42:02 UTC
*** Bug 451065 has been marked as a duplicate of this bug. ***
Comment 27 Tobias G. 2022-04-02 00:26:27 UTC
I also have this issue with Plasma 5.24.3 on Manjaro, using the wayland session and kernel 5.16
Comment 28 steve 2022-04-06 07:13:51 UTC
I also have this issue with Plasma 5.24.4 on Arch, using the wayland session and kernel 5.17.
Comment 29 indecisiveautomator 2022-04-09 16:12:08 UTC
I have this issue with Plasma 5.24.4 on Arch with Kernel 5.17.1, on my laptop and my desktop with the same OS.
Comment 30 Matthew Adie 2022-04-25 19:31:15 UTC
I also have this issue with Plasma 5.24.4 on Arch, using the wayland session and kernel 5.17.4
Comment 31 steve 2022-04-25 19:34:12 UTC
(In reply to steve from comment #28)
> I also have this issue with Plasma 5.24.4 on Arch, using the wayland session
> and kernel 5.17.

Edit: I have found the most convenient workaround right now is to logout the user before shutting down/rebooting.
Comment 32 Troy Dawson 2022-04-25 21:26:33 UTC
What was the real problem with this?  Why was this kernel related?
I haven't seen anything relating to the real problem, just work around so things don't take long to shut down.

We are seeing the same thing (Slow SDDM shutdown) and worse on CentOS Stream 8.  All of it is fine with an older kernel, but the newer kernel is having issues.
Note:  We are seeing a blank screen on SDDM startup.  If you use a different desktop manager, then ksplash is blank.  And then if you lock your screen, you never get a password prompt to unlock it.
Comment 33 postix 2022-04-26 08:30:06 UTC
(In reply to steve from comment #31)
> Edit: I have found the most convenient workaround right now is to logout the
> user before shutting down/rebooting.

I think I can confirm this workaround: 5 s shutting down (once logged out after 2 s) vs 3 minutes waiting.
Comment 34 Christian 2022-11-04 15:01:21 UTC
I can confirm that this bug still exists for me, but that the workaround with logging out before shutting down works.
My system is Plasma 5.26.2 on Arch, using the wayland session and kernel version 6.0.6-arch1-1 (64-bit)
Comment 35 postix 2022-11-04 16:19:53 UTC
The upstream bug was closed without a general solution on Jun 15.

FWIW I keep experiencing it on Plasma 5.26.2 Wayland on openSUSE TW with kernel 6.0.6 and systemd-boot.
The relevant part of journalctl is the following:

```
16:35:11 systemd[1]: user-1000.slice: Consumed 2min 4.592s CPU time.

<--------------------------------------------------------------------------------------->

16:36:40 systemd[1]: display-manager.service: State 'stop-sigterm' timed out. Killing.
16:36:40 systemd[1]: display-manager.service: Killing process 2011 (sddm) with signal SIGKILL.
16:36:40 display-manager[1989]: Starting service sddm
16:36:40 systemd[1]: display-manager.service: Main process exited, code=killed, status=9/KILL
16:36:40 systemd[1]: display-manager.service: Failed with result 'timeout'.
16:36:40 systemd[1]: display-manager.service: Unit process 8024 (Xorg.bin) remains running after unit stopped.
16:36:40 systemd[1]: Stopped X Display Manager.
16:36:40 systemd[1]: display-manager.service: Triggering OnFailure= dependencies.
16:36:40 systemd[1]: Requested transaction contradicts existing jobs: Transaction for plymouth-quit.service/start is destructive (srv.mount has 'stop' job queued, but 'start' is included in transaction).
16:36:40 systemd[1]: display-manager.service: Failed to enqueue OnFailure= job, ignoring: Transaction for plymouth-quit.service/start is destructive (srv.mount has 'stop' job queued, but 'start' is included in transaction).
16:36:40 systemd[1]: Starting Show Plymouth Reboot Screen...
16:36:40 systemd[1]: Stopping User Login Management...
```

Does the proposed workaround in comment 23 only work for sddm git master? Is there any known ETA for a new release?
openSUSE TW comes with SDDM 0.19.0-7.1 and despite setting wayland as the display server, sddm keeps sticking to X11.
Comment 36 Nate Graham 2022-11-04 16:26:49 UTC
The problem is that SDDM needs a new release with the fix in it. I've talked to the SDDM folks and they're going to try to do one soon.