Bug 448517 - Logout/shutdown/restart in wayland session sometimes freezes the UI you used to trigger it and then doesn't do anything
Summary: Logout/shutdown/restart in wayland session sometimes freezes the UI you used ...
Status: RESOLVED DUPLICATE of bug 449948
Alias: None
Product: ksmserver
Classification: Plasma
Component: general (show other bugs)
Version: 5.24.4
Platform: Arch Linux Linux
: VHI major
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords: regression, wayland
Depends on:
Blocks:
 
Reported: 2022-01-15 11:01 UTC by Linus Dierheimer
Modified: 2022-04-16 19:16 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Plasmashell freezing when you click Logout. (88.74 KB, image/png)
2022-01-23 03:01 UTC, Bernie Innocenti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Linus Dierheimer 2022-01-15 11:01:39 UTC
SUMMARY

After the update to the 5.24 Beta, i can't log out of the wayland session anymore (X11 works).

Sometimes It behaves exactly like the option "Directly login after logout" is enabled. I see the fullscreen options, click logout, plasmashell seems to be restarted (like with plasmashell --replace).
Sometimes the system just becomes unresponsive after the click on logout, freezes for about 5 seconds, and then acts like log out was never clicked.

This whole behaviour does only happen if automatic login for sddm is enabled. Changing the option of automatic login after logout doesn't change anything.

Logging out with loginctl kill-session works.

STEPS TO REPRODUCE
1. In SDDM settings, enable automatic login with the plasma wayland session
2. reboot
3. try to log out

OBSERVED RESULT

Logout doesn't happen.

EXPECTED RESULT

Logout does happen

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.16.0 / 5.23.90
(available in About System)
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2022-01-21 01:52:20 UTC
> Sometimes the system just becomes unresponsive after the click on logout, freezes for about 5 seconds, and then acts like log out was never clicked.
I can reproduce that without having autologin enabled, so I suspect it's a different thing. It's super annoying. I was planning to file a bug report about it, but you beat me to it. Let's use this bug report for that and get another one for issues that are isolated to being triggered by autologin.
Comment 2 David Edmundson 2022-01-21 14:38:08 UTC
Can you include SDDM version?

Does switching VTs (control+alt f2 etc) fix anything?
Comment 3 Linus Dierheimer 2022-01-21 14:41:43 UTC
SDDM: 0.19.0-7
Switching to another TTY just brings up the usual console based login. Switching back to plasma doesn't change anything there, if you are fast enough its sometimes even still frozen. Switching to TTY1, where i think sddm runs, brings up a black screen with just the cursor visible.
Comment 4 Nate Graham 2022-01-21 14:47:44 UTC
SDDM 0.19.0

Switching between VTs works, but does not un-wedge plasma for me. If I return to the VT with the session on it, Plasma is still stuck for a bit.
Comment 5 Bernie Innocenti 2022-01-23 02:57:58 UTC
I think I'm hitting this same bug in Fedora Rawhide (plasmashell 5.23.90, sddm 0.19.0).

Attaching a screenshot which shows the frozen application menu. In most cases, the shell recovers after about 10 seconds. I've also seen it crash in a couple of cases, but I wasn't able to attach gdb nor get a stacktrace.
Comment 6 Bernie Innocenti 2022-01-23 03:01:09 UTC
Created attachment 145783 [details]
Plasmashell freezing when you click Logout.
Comment 7 Bernie Innocenti 2022-01-23 03:03:09 UTC
I captured the the journal just before a plasmashell crash:

---cut---
trying to show an empty dialog
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.svg: <input>:303:258: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:463: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:659: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:913: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:1049: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:1251: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:1453: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:1631: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:1739: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:1980: Could not add child element to parent element because the types are incorrect.
qt.svg: <input>:303:2223: Could not add child element to parent element because the types are incorrect.
QWaylandDataOffer: timeout reading from pipe
QWaylandDataOffer: error reading data for mimeType application/x-kde-cutselection
QWaylandDataOffer: timeout reading from pipe
QWaylandDataOffer: error reading data for mimeType application/x-kde-cutselection
The Wayland connection broke. Did the Wayland compositor die?
---cut---

No, kwin_wayland did not die. This is not a crash, it's a clean exit with $?=1
Comment 8 Nate Graham 2022-01-23 03:19:00 UTC
Yep, I see the same symptoms.
Comment 9 Nate Graham 2022-01-28 04:51:23 UTC
I can also confirm that it works correctly in the X11 session.
Comment 10 Nate Graham 2022-02-03 15:59:02 UTC
I'm not able to reproduce this anymore with current git master code; is anyone else? Possibly it got fixed by one of the recent commits for Plasma 5.24.
Comment 11 Bernie Innocenti 2022-02-03 17:53:39 UTC
It just happened to me again with plasmashell from plasma-workspace-5.23.90-2.fc36.x86_64.

Just before this, I did "something" that made the panel miss some button release event, and the task bar was constantly dragging around the apps while moving the mouse over it. The application menu would open with the Super key, but then would not respond to clicks or keyboard input.

After some fiddling, I managed to get out of this state, but now clicking logout freezes the panel with the application menu open for 10 seconds.
Comment 12 Nate Graham 2022-02-03 17:56:09 UTC
Interesting. If you get it out of that state (e.g. by killing and restarting plasmashell) does the hang-on-logout issue still happen? If not, then it may be a separate issue.
Comment 13 Bernie Innocenti 2022-02-05 23:59:50 UTC
(In reply to Nate Graham from comment #12)
> Interesting. If you get it out of that state (e.g. by killing and restarting
> plasmashell) does the hang-on-logout issue still happen? If not, then it may
> be a separate issue.

It just happened to me again in Fedora Rawhide. Killing and restarting plasmashell doesn't fix this issue.
Comment 14 Fushan Wen 2022-02-07 15:17:56 UTC
I can reproduce it by running `systemctl --user stop plasma-ksmserver.service`

So I guess it's related to crashes or unresponsiveness of ksmserver?
Comment 15 Fushan Wen 2022-02-07 15:21:47 UTC
(In reply to Bernie Innocenti from comment #13)
> (In reply to Nate Graham from comment #12)
> > Interesting. If you get it out of that state (e.g. by killing and restarting
> > plasmashell) does the hang-on-logout issue still happen? If not, then it may
> > be a separate issue.
> 
> It just happened to me again in Fedora Rawhide. Killing and restarting
> plasmashell doesn't fix this issue.

Can you run `systemctl --user status plasma-ksmserver.service` to see if there is any error message when this bug happens?
Comment 16 Nate Graham 2022-02-07 15:42:45 UTC
Fushan, you just marked this as fixed by a commit that's a week old but you said you can reproduce it today. Did you not yet have that commit when you tested it?
Comment 17 Fushan Wen 2022-02-07 15:51:00 UTC
(In reply to Nate Graham from comment #16)
> Fushan, you just marked this as fixed by a commit that's a week old but you
> said you can reproduce it today. Did you not yet have that commit when you
> tested it?

No, Bugzilla automatically marked this bug as FIXED after I added "Lastest Commit". I will try to revert the commit.
Comment 18 Viorel-Cătălin Răpițeanu 2022-02-08 07:59:07 UTC
(In reply to Fushan Wen from comment #15)
> (In reply to Bernie Innocenti from comment #13)
> > (In reply to Nate Graham from comment #12)
> > > Interesting. If you get it out of that state (e.g. by killing and restarting
> > > plasmashell) does the hang-on-logout issue still happen? If not, then it may
> > > be a separate issue.
> > 
> > It just happened to me again in Fedora Rawhide. Killing and restarting
> > plasmashell doesn't fix this issue.
> 
> Can you run `systemctl --user status plasma-ksmserver.service` to see if
> there is any error message when this bug happens?

systemctl --user status plasma-ksmserver.service
× plasma-ksmserver.service - KDE Session Management Server
     Loaded: loaded (/run/user/1000/systemd/user.control/plasma-ksmserver.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-02-08 09:56:01 EET; 1min 18s ago
    Process: 1688 ExecStart=/home/username/kde/usr/bin/ksmserver (code=exited, status=1/FAILURE)
   Main PID: 1688 (code=exited, status=1/FAILURE)
        CPU: 95ms

feb 08 09:56:00 hostname systemd[1600]: Starting KDE Session Management Server...
feb 08 09:56:00 hostname ksmserver[1688]: Qt: Session management error: networkIdsList argument is NULL
feb 08 09:56:00 hostname systemd[1600]: Started KDE Session Management Server.
feb 08 09:56:01 hostname ksmserver[1688]: The X11 connection broke (error 1). Did the X11 server die?
feb 08 09:56:01 hostname systemd[1600]: plasma-ksmserver.service: Main process exited, code=exited, status=1/FAILURE
feb 08 09:56:01 hostname systemd[1600]: plasma-ksmserver.service: Failed with result 'exit-code'.
Comment 19 Fushan Wen 2022-02-18 08:36:14 UTC
Can still reproduce on git master

Information for package plasma5-workspace:
------------------------------------------
Repository     : unstable-kde-frameworks
Name           : plasma5-workspace
Version        : 5.24.80git.20220217T112240~4d68f4b25-ku.33.2
Arch           : x86_64
Vendor         : obs://build.opensuse.org/KDE:Unstable
Installed Size : 27.1 MiB
Installed      : Yes
Status         : up-to-date
Source package : plasma5-workspace-5.24.80git.20220217T112240~4d68f4b25-ku.33.2.src
Summary        : The KDE Plasma Workspace Components


> systemctl --user status plasma-ksmserver.service --no-pager -l
× plasma-ksmserver.service - KDE Session Management Server
     Loaded: loaded (/usr/lib/systemd/user/plasma-ksmserver.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2022-02-18 15:06:52 CST; 1h 27min ago
    Process: 14746 ExecStart=/usr/bin/ksmserver (code=exited, status=1/FAILURE)
   Main PID: 14746 (code=exited, status=1/FAILURE)
        CPU: 117ms

2月 18 15:05:16 ZHAN66 systemd[2734]: Starting KDE Session Management Server...
2月 18 15:05:16 ZHAN66 ksmserver[14746]: Qt: Session management error: networkIdsList argument is NULL
2月 18 15:05:16 ZHAN66 systemd[2734]: Started KDE Session Management Server.
2月 18 15:06:51 ZHAN66 ksmserver[14746]: The X11 connection broke (error 1). Did the X11 server die?
2月 18 15:06:52 ZHAN66 systemd[2734]: plasma-ksmserver.service: Main process exited, code=exited, status=1/FAILURE
2月 18 15:06:52 ZHAN66 systemd[2734]: plasma-ksmserver.service: Failed with result 'exit-code'.
Comment 20 Bernie Innocenti 2022-02-23 09:20:49 UTC
I'm running Fedora 36 with Plasma 5.24.0 and I just installed the updates to 5.24.1.
I was going to restart the session to start using the updated desktop components, but I hit this bug again.

ksmserver was indeed dead, exactly as described in comment #19.

I restarted it (systemctl --user restart plasma-ksmserver.service), but it did not cure the problem: the menu still freezes when I select Restart.
Comment 21 Nate Graham 2022-02-23 20:19:04 UTC
*** Bug 450716 has been marked as a duplicate of this bug. ***
Comment 22 Bernie Innocenti 2022-03-19 04:04:16 UTC
I wonder if there's any relation to bug #449948?
Comment 23 Nate Graham 2022-04-10 16:30:01 UTC
Indeed, it is likely that this is the same as Bug 449948, which says that the issue is 100% reproducible if kwin_wayland has crashed and restarted automatically, or was killed and restarted manually.

Can everyone else confirm?
Comment 24 Nate Graham 2022-04-13 19:10:37 UTC
*** Bug 446143 has been marked as a duplicate of this bug. ***
Comment 25 Bernie Innocenti 2022-04-15 07:13:53 UTC
(In reply to Nate Graham from comment #23)
> Indeed, it is likely that this is the same as Bug 449948, which says that
> the issue is 100% reproducible if kwin_wayland has crashed and restarted
> automatically, or was killed and restarted manually.
> 
> Can everyone else confirm?

Confirming: today kwin_wayland crashed, and after it restarted I immediately tried to logout and plasmashell froze for serveral seconds.

I was using Fedora 36 with plasma-desktop-5.24.4-1.fc36.x86_64 (but possibly the session was started when I was still running 5.24.3).
Comment 26 Nate Graham 2022-04-16 19:16:13 UTC

*** This bug has been marked as a duplicate of bug 449948 ***