Bug 422870

Summary: Reboot and shutdown result in logout
Product: [Plasma] plasmashell Reporter: Arkadi Statsenko <arkadistatsenko>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: axel.braun, basjetimmer, bingmybong, bugseforuns, demm, grihad, hamelg, me, melkevizth, nate, pip.kde, plasma-bugs
Priority: VHI Keywords: regression
Version: 5.19.0   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.19.2
Sentry Crash Report:
Attachments: Logout output form dbus-monitor
dbus log when powering off
journal-follow log

Description Arkadi Statsenko 2020-06-12 13:12:20 UTC
SUMMARY


STEPS TO REPRODUCE
1. Log in to plasma desktop after turning on the computer or rebooting
2. choose "reboot" in global menu and hit Enter.
3. instead of rebooting the logout occurs.

OBSERVED RESULT
When I choose "Reboot", the system should reboot.

EXPECTED RESULT


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

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2020-06-13 00:25:06 UTC
*** Bug 422834 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2020-06-13 00:26:06 UTC
Cannot reproduce FWIW. But we are getting multiple reports of it in the wild (including bug-report-by-social-media... https://www.reddit.com/r/kde/comments/h7kw4p/cant_easily_shut_down_anymore/).
Comment 3 Patrick Silva 2020-06-13 00:59:35 UTC
duplicate of bug 422853
Comment 4 Nate Graham 2020-06-13 01:05:24 UTC
Related, but not quite the same: that one says it only happens with network users, not local users.
Comment 5 David Edmundson 2020-06-13 10:09:25 UTC
Can someone run

dbus-monitor   > someLog


and logout

then attach someLog

 here.
Comment 6 BingMyBong 2020-06-13 11:38:38 UTC
Created attachment 129307 [details]
Logout output form dbus-monitor

I got prompted to say dbus-monitor was running during the logout which i just cancelled
Comment 7 BingMyBong 2020-06-13 11:39:35 UTC
(In reply to BingMyBong from comment #6)
> Created attachment 129307 [details]
> Logout output form dbus-monitor
> 
> I got prompted to say dbus-monitor was running during the logout which i
> just cancelled

my config:
opensuse:tumbleweed:20200611
Qt: 5.15.0 KDE Frameworks: 5.70.0 - KDE Plasma:  5.19.0 - kwin 5.19.0
kmail2 5.14.1 (20.04.0) - akonadiserver 5.14.1 (20.04.0) - Kernel:  5.6.14-1-default  - xf86-video-nouveau:  1.0.16
Comment 8 David Edmundson 2020-06-13 12:36:29 UTC
method call time=1592048032.192546 sender=:1.71 -> destination=org.kde.ksmserver serial=46 path=/KSMServer; interface=org.kde.KSMServerInterface; member=logout
   int32 0
   int32 0
   int32 -1


is a legacy call. How are you triggering the logout?



method call time=1592048032.199337 sender=:1.14 -> destination=org.kde.Shutdown serial=69 path=/Shutdown; interface=org.kde.Shutdown; member=logout

The modern code is explicitly telling it to logout not reboot.
Comment 9 basjetimmer 2020-06-13 12:39:09 UTC
(In reply to Nate Graham from comment #2)
> Cannot reproduce FWIW. But we are getting multiple reports of it in the wild
> (including bug-report-by-social-media...
> https://www.reddit.com/r/kde/comments/h7kw4p/cant_easily_shut_down_anymore/).

Well, that's me. So, my symptoms appear the same except I have so far only tried it with shutting down as opposed to rebooting. One more interesting thing: if, after trying to shut down and being dropped in the sddm login screen, if I log in quickly enough (within say 10 seconds) the poweroff actually completes! So I log in, and then suddenly the machine turns off....

Anyway, I have a dbus-monitor log of running 'qdbus org.kde.ksmserver /KSMServer logout 0 2 2' attached (behavior is the same as choosing 'power/session'->'shut down' from the main kmenu. Thanks!
Comment 10 basjetimmer 2020-06-13 12:39:42 UTC
Created attachment 129310 [details]
dbus log when powering off
Comment 11 David Edmundson 2020-06-13 12:59:46 UTC
What does:

qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndShutdown

do?
Comment 12 Paul 2020-06-13 13:28:31 UTC
(In reply to David Edmundson from comment #11)
> What does:
> 
> qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndShutdown
> 
> do?

On two openSUSE Tumbleweed systems, (for which it needs to be qdbus-qt5 ...), that command results in a logout and return to the SDDM login screen, no shutdown.
Comment 13 Iyán Méndez Veiga 2020-06-14 15:56:43 UTC
I confirm same issue both when trying to poweroff or reboot.
Comment 14 David Edmundson 2020-06-16 11:17:00 UTC
X or wayland?
Is everyone here on SuSE?

---

Can someone run the following:

log in

run
qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndShutdown

(qdbus or qdbus-qt5 whatever is appropriate)

then when they get locked out:


go to a real VT (control+alt+f5) 
login
cp ~/.local/share/sddm/xorg-session.log ~/LogForDave.txt 

then go back to the login screen (control+alt+f1) and upload the log in your home folder.
Comment 15 Paul 2020-06-16 12:19:22 UTC
Using X, not wayland.

openSUSE:
Operating System: openSUSE Tumbleweed 20200614
KDE Plasma Version: 5.19.0
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0
Kernel Version: 5.7.1-1-default
OS Type: 64-bit
Processors: 2 × AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
Memory: 3.8 GiB of RAM
Graphics Processor: NV84


Cold boot
Log in
From konsole issued "qdbus-qt5 org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndShutdown"
Resulted in log out and return to SDDM log in screen
Switched to virtual console
Log in as normal user and executed "cp ~/.local/share/sddm/xorg-session.log ~/LogForDave.txt"
Exit from virtual console and log in via SDDM log in screen

and this is the LogForDave:

gpg-connect-agent: no gpg-agent running in this session
gpg-connect-agent: no gpg-agent running in this session
QML debugging is enabled. Only use this in a safe environment.
klauncher: Exiting on signal 15
klauncher: Exiting on signal 1
startkde: Starting up...
startkde: Shutting down...
startkde: Done.
XIO:  fatal IO error 0 (Success) on X server ":0"
      after 2114 requests (2114 known processed) with 0 events remaining.
XIO:  fatal IO error 0 (Success) on X server ":0"
      after 2114 requests (2114 known processed) with 0 events remaining.
Application::crashHandler() called with signal 11; recent crashes: 1
malloc_consolidate(): invalid chunk size
KCrash: Application 'kwin_x11' crashing...
KCrash: Attempting to start /usr/lib64/libexec/drkonqi


and that's all there was...
Comment 16 David Edmundson 2020-06-16 12:28:56 UTC
That doesn't sound like enough content :/

Was the tiemstamp on ~/.local/share/sddm/xorg-session.log correct?

Some distros seem to like moving it around.
Comment 17 Iyán Méndez Veiga 2020-06-16 12:36:22 UTC
I'm on Arch, also with X not Wayland.

Linux 5.7.2
KDE Plasma: 5.19.0
KDE Frameworks: 5.71.0
Qt Version: 5.15.0

And the ~/.local/share/sddm/xorg-session.log

kdeinit5: preparing to launch '/usr/lib/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 1345, result = 0
kdeinit5: opened connection to :0
kdeinit5: Got SETENV 'GTK_RC_FILES=/etc/gtk/gtkrc:/home/iyan/.gtkrc:/home/iyan/.config/gtkrc' from launcher.
kdeinit5: Got SETENV 'GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/iyan/.gtkrc-2.0:/home/iyan/.config/gtkrc-2.0' from launcher.
kdeinit5: Got SETENV 'XCURSOR_THEME=breeze_cursors' from launcher.
kdeinit5: Got SETENV 'XCURSOR_SIZE=24' from launcher.
kdeinit5: Got SETENV 'SESSION_MANAGER=local/master:@/tmp/.ICE-unix/1374,unix/master:/tmp/.ICE-unix/1374' from launcher.
QML debugging is enabled. Only use this in a safe environment.
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/http.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/http.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/file.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/file.so'
kdeinit5: Got EXT_EXEC '/usr/bin/kwalletmanager5' from launcher.
kdeinit5: preparing to launch '/usr/bin/kwalletmanager5'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/http.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/http.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/http.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/http.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/http.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/http.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/file.so'
kdeinit5: PID 2137 terminated.
kdeinit5: PID 1973 terminated.
kdeinit5: PID 1968 terminated.
kdeinit5: terminate KDE.
klauncher: Exiting on signal 15
klauncher: Exiting on signal 1
startkde: Starting up...
startkde: Shutting down...
startkde: Done.
Application::crashHandler() called with signal 11; recent crashes: 1
malloc_consolidate(): invalid chunk size
XIO:  fatal IO error 39 (Directory not empty) on X server ":0"
      after 1907 requests (1907 known processed) with 0 events remaining.
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kwin_x11 path = /usr/bin pid = 1361
KCrash: Arguments: /usr/bin/kwin_x11 
KCrash: Attempting to start /usr/lib/drkonqi
KCrash: Attempting to start /usr/bin/plasmashell
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = plasmashell path = /usr/bin pid = 1401
KCrash: Arguments: /usr/bin/plasmashell 
KCrash: Attempting to start /usr/lib/drkonqi
Warning: socket path is too long
QML debugging is enabled. Only use this in a safe environment.
Comment 18 Paul 2020-06-16 13:10:49 UTC
(In reply to David Edmundson from comment #16)
> That doesn't sound like enough content :/
> 
> Was the tiemstamp on ~/.local/share/sddm/xorg-session.log correct?
> 
> Some distros seem to like moving it around.

Just repeated it...

Time stamp correct
-rw------- 1 paul users 608 Jun 16 14:05 xorg-session.log

and again a very short, but slightly different log
gpg-connect-agent: no gpg-agent running in this session
gpg-connect-agent: no gpg-agent running in this session
QML debugging is enabled. Only use this in a safe environment.
klauncher: Exiting on signal 1
startkde: Starting up...
startkde: Shutting down...
startkde: Done.
XIO:  fatal IO error 2 (No such file or directory) on X server ":0"
      after 2044 requests (2044 known processed) with 0 events remaining.
Application::crashHandler() called with signal 11; recent crashes: 1
malloc_consolidate(): invalid chunk size
KCrash: Application 'kwin_x11' crashing...
KCrash: Attempting to start /usr/lib64/libexec/drkonqi
Comment 19 David Edmundson 2020-06-16 15:30:39 UTC
and to confirm some more things 

what is the output of

qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot



qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot
Comment 20 Paul 2020-06-16 16:31:06 UTC
paul@Orion-15:~$ qdbus-qt5 --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanReboot
yes

paul@Orion-15:~$ qdbus-qt5 --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot
Error: org.freedesktop.DBus.Error.InvalidArgs
Invalid arguments '' to call org.freedesktop.login1.Manager.Reboot(), expecting 'b'.
Comment 21 Paul 2020-06-16 16:52:48 UTC
(In reply to Paul from comment #20)

> paul@Orion-15:~$ qdbus-qt5 --system org.freedesktop.login1
> /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot
> Error: org.freedesktop.DBus.Error.InvalidArgs
> Invalid arguments '' to call org.freedesktop.login1.Manager.Reboot(),
> expecting 'b'.

Follow up. If I append boolean:true the system reboots

qdbus-qt5 --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true
Comment 22 David Edmundson 2020-06-16 16:55:55 UTC
That puts the problem definitely in KDE code somewhere. Probably my code.

Though I'm still not really sure what.
Comment 23 Iyán Méndez Veiga 2020-06-16 17:18:39 UTC
Exactly same output as @Paul for both commands. So @David Edmundson, you cannot replicate this behavior on your system? Does it work for you?
Comment 24 Paul 2020-06-16 17:53:13 UTC
(In reply to David Edmundson from comment #22)
> That puts the problem definitely in KDE code somewhere. Probably my code.
> 
> Though I'm still not really sure what.

OK...

As mentioned in the duplicate Bug 422834 This only manifested itself after the update to Plasma 5.19.0, prior to that both Shutdown and Restart worked as expected.
Comment 25 David Edmundson 2020-06-16 17:53:46 UTC
Yes, it works for me on, and on a clean VM and for everyone I've asked.

It's not broken in the common case, just some edge cases
Comment 26 Iyán Méndez Veiga 2020-06-16 19:37:44 UTC
In a fresh KDE Neon VM I don't have that problem. But still the command you asked us before to try also doesn't work.:
qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot

I realized that KDE Neon uses Qt 5.14.2 but BingMyBong, Paul and I have Qt 5.15.0. What QT are you using in your VM?
Comment 27 Iyán Méndez Veiga 2020-06-16 19:50:55 UTC
Okay, this is very weird. After updating KDE Neon, now sometimes it works and sometimes it doesn't, and it logs out as in my Arch host system.

After several tries, my guess is that time matters. If I start the VM, log in, and then immediately turn it off, it works. If, however, I wait a bit or use the VM for a while, shutdown fails and I get a log out.

Hopefully you can replicate this behavior.
Comment 28 David Edmundson 2020-06-16 19:59:13 UTC
I suspect ksmserver is crashing on session save, it'd cause what we see here.
Comment 29 Iyán Méndez Veiga 2020-06-16 22:02:54 UTC
But if that's the case, shouldn't it be avoidable if I use "Start with an empty session" on preferences? Or does ksmserver always save the session?
Comment 30 David Edmundson 2020-06-17 04:13:54 UTC
It always runs something in order for apps to do the "you have unsaved changes" prompts.
Comment 31 Paul 2020-06-17 12:43:52 UTC
I've just tested with new users on both my openSUSE Tumbleweed machines.

Both still exhibit the erroneous behaviour, so I guess that rules out anything in the users (KDE) configuration.

Unlike &Iyán Méndez Veiga (comment 27) I'm seeing this consistently, nor can I replicate the works correctly if I "log in, and then immediately turn it off".
Comment 32 hamelg 2020-06-18 20:12:32 UTC
Here,

When I select "Leave..." in the standard menu on desktop, the behavior is correct : it matched my current setup in "Startup and Shutdown" >> "Desktop Session" >> "Default Leave Option" on "End current session".
But when pressing button "Leave..." on widget Lock/logout, the default action is incorrect : it shutdowns my machine.
Comment 33 David Edmundson 2020-06-18 21:20:24 UTC
>But when pressing button "Leave..." on widget Lock/logout, the default action is incorrect : it shutdowns my machine.

Ok, maybe this report is mixing up two bugs which would explain some things.

Some random widget using the old API and that not being mapped correctly would match the original logs. But in that case "qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndShutdown" would work correctly.
Comment 34 basjetimmer 2020-06-18 22:33:59 UTC
(In reply to David Edmundson from comment #33)
> >But when pressing button "Leave..." on widget Lock/logout, the default action is incorrect : it shutdowns my machine.
> 
> Ok, maybe this report is mixing up two bugs which would explain some things.
> 
> Some random widget using the old API and that not being mapped correctly
> would match the original logs. But in that case "qdbus org.kde.Shutdown
> /Shutdown org.kde.Shutdown.logoutAndShutdown" would work correctly.

I think it is only hamelg (comment #32) who is describing a different bug. All others here are just using the normal kmenu "power/session" entries or the dbus commands mentioned in this bug report. Also, the problem with everyone is that they can only get logged out and dropped in the sddm login screen, whereas hamelg actually (inadvertently) manages to shut down.

For me both dbus commands ('qdbus org.kde.ksmserver /KSMServer logout 0 2 2' and 'qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndShutdown') as well as a graphical shut down from the kmenu, result in just getting logged out. The same thing happens on both my desktop and my laptop (since 5.19.0).
Comment 35 Paul 2020-06-19 08:45:41 UTC
Yes, as @basjetimmer wrote, and just to clarify my own case:

From a KDE session neither:

Menu -> Power/Session -> Reboot (or) Shutdown
Desktop Context Menu -> Leave -> Reboot (or) Shutdown

will result in a Reboot or Shutdown, but a return to the SDDM login screen, from there Reboot or Shutdown work as expected.
Comment 36 Nate Graham 2020-06-19 18:07:56 UTC
*** Bug 423198 has been marked as a duplicate of this bug. ***
Comment 37 JSladek 2020-06-19 19:10:08 UTC
Commenting on Paul clarification (comment #35) - 

On PCLinuxOS DarkStar I have the similar symptons with the difference being:

With SDDM - after display of the login, I can only continue on to reboot or shutdown only by hitting the reboot or shutdown icon in the upper right corner

With GDM - after display of the login, reboot or shutdown continues probably
due to a 1 sec login retry security setting in gdmsetup
Comment 38 David Edmundson 2020-06-19 21:10:02 UTC
I know this is a cop-out, but if someone can find/make me a live CD ISO that I can run in virtualbox which will reproduce this out of the box they will be my hero.
Comment 39 David Edmundson 2020-06-19 21:18:39 UTC
Also can I have someone's ~/.config/ksmserverrc
Comment 40 JSladek 2020-06-19 21:26:31 UTC
(In reply to David Edmundson from comment #39)
> Also can I have someone's ~/.config/ksmserverrc

[$Version]
update_info=ksmserver_update_loginMode_value.upd:ksmserver_update_loginMode_value_default_enum

[General]
excludeApps=
loginMode=emptySession
shutdownType=2
Comment 41 Iyán Méndez Veiga 2020-06-20 07:44:49 UTC
(In reply to David Edmundson from comment #39)
> Also can I have someone's ~/.config/ksmserverrc

[$Version]
update_info=ksmserver_update_loginMode_value.upd:ksmserver_update_loginMode_value_default_enum

[General]
confirmLogout=false
excludeApps=
loginMode=emptySession
offerShutdown=true
screenCount=1
shutdownType=0

[LegacySession: saved at previous logout]
count=0

[Session: saved at previous logout]
clientId1=10d2d37374000148864348700000005170003
clientId2=10d2d37374000148864348700000005170006
clientId3=10d2d37374000148864348800000005170007
clientId4=10d2d37374000148864348900000005170008
clientId5=10d2d37374000148864361000000005170011
count=5
discardCommand1[$e]=rm,$HOME/.config/session/kwin_10d2d37374000148864348700000005170003_1488643666_320774
discardCommand5[$e]=rm,$HOME/.config/session/kontact_10d2d37374000148864361000000005170011_1488643611_854393
program1=kwin_x11
program2=/usr/lib/org_kde_powerdevil
program3=/usr/bin/korgac
program4=pulseaudio
program5=/usr/bin/kontact
restartCommand1=kwin_x11,-session,10d2d37374000148864348700000005170003_1488643666_320774
restartCommand2=/usr/lib/org_kde_powerdevil,-session,10d2d37374000148864348700000005170006_1488643651_973618
restartCommand3=/usr/bin/korgac,-session,10d2d37374000148864348800000005170007_1488643651_973550
restartCommand4=
restartCommand5=/usr/bin/kontact,-session,10d2d37374000148864361000000005170011_1488643611_854393
restartStyleHint1=0
restartStyleHint2=0
restartStyleHint3=0
restartStyleHint4=0
restartStyleHint5=0
userId1=iyan
userId2=iyan
userId3=iyan
userId4=iyan
userId5=iyan
wasWm1=true
wasWm2=false
wasWm3=false
wasWm4=false
wasWm5=false

[SubSession: c5cf22fb-d99b-4c4e-8768-3ccf01d73d81]
count=0
Comment 42 Paul 2020-06-20 08:41:05 UTC
(In reply to David Edmundson from comment #39)
> Also can I have someone's ~/.config/ksmserverrc

[$Version]
update_info=ksmserver_update_loginMode_value.upd:ksmserver_update_loginMode_value_default_enum

[General]
confirmLogout=false
excludeApps=
loginMode=emptySession
screenCount=1
Comment 43 Paul 2020-06-20 08:46:31 UTC
(In reply to David Edmundson from comment #38)
> I know this is a cop-out, but if someone can find/make me a live CD ISO that
> I can run in virtualbox which will reproduce this out of the box they will
> be my hero.

OK... This is very strange :(

Both of my openSUSE Tumblweed installs exhibit this bug, they are currently running "Snapshot" 20200618.

I've just downloaded that snapshot as a Live Image...

http://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20200618-Media.iso

http://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20200618-Media.iso.sha256

used "dd" to write to a USB stick, and booted (same hardware as the installed version).

I don't see the problem, both Shutdown and Reboot work as expected.

Repeated the boot from Live USB for the second machine, ditto.
Comment 44 David Edmundson 2020-06-20 10:47:31 UTC
Does journalctl tell us anything?
Comment 45 Paul 2020-06-20 11:34:00 UTC
Created attachment 129544 [details]
journal-follow log

Following log obtained by:

Regular user (paul) logged in to a kde session.
Switch to VT and log in as root.
root issues "journalctl --follow > /home/paul/journal-follow.log"
Switch back to kde session.
From desktop context menu -> Leave -> Shutdown
(returned to SDDM login screen, no shutdown)
Switch back to root user and terminate journalctl --follow
root logout and return to SDDM login screen, login as normal user and retrieve log file.
Comment 46 Iyán Méndez Veiga 2020-06-20 12:38:31 UTC
I also cannot replicate the issue in a VM with archlinux. Just a crazy thought: maybe intel microcode is the edge case that @David Edmundson is looking for? I have received a few updates on that lately. I will investigate a bit more.
Comment 47 Paul 2020-06-20 13:05:14 UTC
(In reply to Iyán Méndez Veiga from comment #46)
> I also cannot replicate the issue in a VM with archlinux. Just a crazy
> thought: maybe intel microcode is the edge case that @David Edmundson is
> looking for? I have received a few updates on that lately. I will
> investigate a bit more.

Both my machines are AMD based, I don't even have ucode-intel (ucode-intel-20200609-1.1) installed...
Comment 48 David Edmundson 2020-06-20 17:12:08 UTC
Got it :/

There's a one character typo which then exposes a race condition on whether plasma-shutdown processes ksmserver before startkde does.

Thanks for all your help.
Comment 49 David Edmundson 2020-06-20 17:13:39 UTC
*processes ksmserver quitting
Comment 50 Bug Janitor Service 2020-06-20 17:21:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/101
Comment 51 Iyán Méndez Veiga 2020-06-20 18:02:54 UTC
Wow... just a missing capital letter. Thanks for fixing it!
Comment 52 Iyán Méndez Veiga 2020-06-20 21:42:01 UTC
I confirm that the tiny little patch fixes the problem :D
Comment 53 David Edmundson 2020-06-21 12:05:08 UTC
> Git commit aaed0138ca8feebb9d45b9c4a2dfd5df651ad972 by David Edmundson.
> Committed on 21/06/2020 at 12:03.
> Pushed by davidedmundson into branch 'Plasma/5.19'.
>
> Fix case of monitored service in startplasma's shutdown
>
> Startplasma monitors ksmserver and tears down the session if it goes
> away, to match previous behaviour and as some lockscreen bypass
> protection.
>
> When we teardown our new binary plasma-shutdown appears, runs scripts
> and makes the final shutdown call. ksmserver could gracefully quit in
> the meantime, so startplasma guarded this case and waited till both
> names exited. However it contains a really stupid typo.
>
> M  +1    -1    startkde/startplasma.cpp
Comment 54 Nate Graham 2020-06-30 16:43:00 UTC
*** Bug 423477 has been marked as a duplicate of this bug. ***
Comment 55 rihad 2023-09-15 05:27:28 UTC
> I confirm that the tiny little patch fixes the problem :D

What patch?
Same problem on Debian Buster 10.13
Comment 56 Nate Graham 2023-09-15 16:50:12 UTC
Please upgrade; you're using ancient software that's missing years of bugfixes.
Comment 57 rihad 2023-09-16 05:32:21 UTC
Debian Buster is actually an LTS release until the end of June 2024. One of Debian stable release drawbacks is that unless a package has a security vulnerability it will almost never get fixed during the lifetime of that release. And this "log out instead of shutting down" problem is more of a UX issue than anything else. But point taken, I will upgrade!) Thanks.