https://bugs.kde.org/show_bug.cgi?id=528681
Bug ID: 528681
Summary: Greeter survives a grace-time unlock; every later lock
starts no greeter ("QProcess::start: Process is
already running") and leaves a black screen with only
a cursor
Classification: Plasma
Product: plasmashell
Version First 6.8.2
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Screen locking
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: 1.0
After a grace-time unlock (idle auto-lock, then user activity within
LockGrace), KSldApp::unlock() calls
doUnlock() immediately and only sends SIGTERM to the greeter. On my system the
greeter does not exit on that
SIGTERM. KSldApp keeps the live process in m_lockProcess, so every subsequent
lock() sets m_lockState = Locked
but startLockProcess() silently fails:
kwin_wayland: QProcess::start: Process is already running
If the user is still at the machine, the next lock is again dismissed within
the grace time (doUnlock() does not
need a greeter), so nothing seems wrong. The first lock that outlives the grace
time leaves the session locked
with no greeter: a black screen with only the mouse cursor and no way to enter
a password. The only recovery is
from a VT.
This happened twice on this machine (2026-10-30 and 2026-11-10), each time with
the same log sequence.
ENVIRONMENT
-----------
- openSUSE Tumbleweed, kernel 7.3.1
- Plasma 6.8.2 (kscreenlocker6 6.8.2, kwin6 6.8.2, plasma6-workspace 6.8.2), Qt
6.12.0, Wayland session
- NVIDIA Quadro P600 (Pascal), proprietary driver 580.196.07,
libnvidia-egl-wayland 1.1.22
- Two monitors (DP-1, DP-4)
- kscreenlockerrc: defaults (Autolock on, LockGrace 5 s); no fingerprint reader
and no fprintd installed, but
/usr/lib/pam.d/kde-fingerprint exists, so the greeter starts a
kde-fingerprint worker
OBSERVED TIMELINE (2026-11-10, journal excerpts, hostname removed)
------------------------------------------------------------------
16:32:53 kscreenlocker_greet[204074] starts (idle lock, args: --graceTime
5000). Workers started:
"kscreenlocker_worker kde-fingerprint <user>" and
"kscreenlocker_worker kde <user>".
The greeter logs the usual startup lines plus "Worker not ready yet,
cannot authenticate."
The user moves the mouse within the grace time and the desktop comes
back (krunner used at 16:33:33,
then normal desktop use until 17:08). There is no unlock or "Worker
did not terminate in time" line for
this greeter, unlike all password unlocks earlier that day.
16:52:32 kwin_wayland: QProcess::start: Process is already running <- idle
lock, no greeter started;
user
was present, grace unlock
17:08:30 kwin_wayland: QProcess::start: Process is already running <- idle
lock, user away; session locked
for
real with no greeter
18:43 User returns: black screen with only the cursor. Switches to tty1.
State checked from tty1 at 18:50:
- greeter 204074 still alive: 7 threads (main, QDBusConnection, QQmlThread, 4x
QSGRenderThread), all sleeping,
total CPU time < 1 s since 16:32. /proc status: SigCgt includes SIGTERM
(KSignalHandler), SigPnd/ShdPnd = 0.
Both workers (kde-fingerprint, kde) still alive.
- Only one kscreenlocker_greet process exists.
- loginctl show-session <wayland session>: LockedHint=yes
- org.freedesktop.ScreenSaver.GetActive = true; GetActiveTime = 6111600, i.e.
ms since exactly 17:08:30, which
matches the second "already running" warning.
- kwin_wayland itself was healthy: main thread idle in ppoll in
QEventDispatcherUNIX, no thread in D state.
Recovery that worked (as the session user, no root):
kill -9 <greeter pid> && loginctl unlock-session <wayland session id>
kwin then logged "Greeter Process encountered an unhandled error:
QProcess::Crashed". No new greeter was started,
because the finished handler takes the s_graceTimeKill branch (still set from
the grace unlock) and returns.
unlock-session then went through requestUnlock -> NotRunning -> doUnlock(). The
order matters: with the greeter
still alive, unlock-session only sends another SIGTERM, which is ignored.
SECOND OCCURRENCE (2026-10-30, same boot sequence)
--------------------------------------------------
13:52:20 kscreenlocker_greet[467773] starts (no password unlock logged
afterwards)
14:01:01 kscreenlocker_greet[468541] starts (no password unlock logged
afterwards)
14:33:26 kwin_wayland: QProcess::start: Process is already running
14:55 System suspended while in the greeter-less lock; after resume the
screen was black and the user had to
recover from a VT.
ANALYSIS (ksldapp.cpp at v6.8.2; unlock(), lock() and startLockProcess() are
identical on master today)
------------------------------------------------------------------------------------------------------
1. KSldApp::unlock() in grace time:
doUnlock(); // "the process might take some time to
exit; don't wait for that to happen"
s_graceTimeKill = true;
m_lockProcess->terminate(); // SIGTERM only, no follow-up
Nothing ever checks that the greeter actually exits, and there is no SIGKILL
fallback.
2. KSldApp::lock() sets m_lockState = Locked, m_lockedTimer.restart(),
m_logind->setLocked(true) and calls
startLockProcess(). startLockProcess() calls m_lockProcess->start() without
checking m_lockProcess->state().
With the old greeter still running, QProcess::start() only prints a qWarning
and returns. errorOccurred is not
emitted, so the FailedToStart fallback (doUnlock) and the
crash/emergency-window logic never run. The result is
a Locked session with no greeter.
3. Related, found by code reading only (not observed): lock() with state !=
Unlocked and EstablishLock::Immediate
calls kill(m_lockProcess->processId(), SIGUSR1) without checking the pid.
QProcess::processId() returns 0 when
no process is running, and kill(0, SIGUSR1) signals the whole process group
of kwin_wayland. That state is
reachable: Locked with no running greeter, e.g. after the 4th greeter crash
(emergency window) or after the greeter
was killed, followed by a logind Lock request (for example, lock before
sleep).
Suggested fixes:
- In startLockProcess(), if m_lockProcess->state() != NotRunning, kill the
stale greeter (SIGKILL) and
waitForFinished() before start(), or at least treat it as a start failure.
- In the grace-time unlock path, arm a timer that SIGKILLs the greeter if it
has not exited within a few seconds.
- Guard the SIGUSR1 kill() in lock() with processId() > 0.
OPEN QUESTION: WHY THE GREETER IGNORED SIGTERM
---------------------------------------------
Unknown. The greeter is non-dumpable (debug logging off), and I recovered
before taking a root backtrace. The
greeter's SIGTERM handler (main.cpp signalHandler -> instance->exit(1)) should
have ended it, so either the
signal was not processed or the process hangs during teardown after exec()
returns. Possibly relevant, not
verified: in grace mode the greeter windows are never shown, and the session
uses NVIDIA egl-wayland with explicit
sync. That same egl-wayland has a known fd leak in its explicit-sync path
(github.com/NVIDIA/egl-wayland/issues/196),
which is present in this session's plasmashell. Bug 477326 (black screen after
grace cancel with a fingerprint
worker) was also similar.
I can try to reproduce with "kscreenlocker_greet.debug=true" in
~/.config/QtProject/qtlogging.ini (that also
makes the greeter dumpable) and attach the debug log plus a full backtrace of
the stuck greeter.
WORKAROUND
----------
Set LockGrace=0 in ~/.config/kscreenlockerrc [Daemon] ("unlock without
password" grace time = 0). Idle locks then
start without grace time, so unlock() never takes the early-doUnlock path.
--
You are receiving this mail because:
You are watching all bug changes.