https://bugs.kde.org/show_bug.cgi?id=527691

            Bug ID: 527691
           Summary: kscreenlocker_greet segfaults in ~QQuickItemView
                    (removeItemChangeListener) when quitting after
                    successful unlock with Qt 6.12; looks like password
                    rejected, ends in emergency mode
    Classification: Plasma
           Product: plasmashell
      Version First 6.8.0
       Reported In:
          Platform: openSUSE
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: Screen locking
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

STEPS TO REPRODUCE
1. Plasma 6.8.0 Wayland session, Qt 6.12.0, single monitor.
2. Lock the screen (Meta+L).
3. Type the correct password and press Enter.

OBSERVED RESULT
Authentication succeeds (pam_kwallet5(kde:setcred) is logged), then
kscreenlocker_greet
crashes while tearing down its views after Qt.quit(). KWin treats it as a
greeter crash
and restarts it, so to the user it looks like the correct password was rejected
and asked
for again. After 4 restarts KWin logs "Need to put Greeter in emergency mode"
and the
session can only be recovered from a VT with `loginctl unlock-session`.
Reproducible on every lock since upgrading to Plasma 6.8.0 / Qt 6.12.0 (it did
not occur
on Plasma 6.7.5 / Qt 6.11.2).

EXPECTED RESULT
The greeter exits cleanly and the session unlocks.

BACKTRACE
(obtained by enabling `kscreenlocker_greet.debug=true` in qtlogging.ini, which
makes the
greeter dumpable; debug symbols for Qt were not available)

#0  ??? () at /lib64/libQt6Quick.so.6
#1  QQuickItemPrivate::removeItemChangeListener(QQuickItemChangeListener*,
QFlags<QQuickItemPrivate::ChangeType>) () at /lib64/libQt6Quick.so.6
#2  QQuickItemView::~QQuickItemView() () at /lib64/libQt6Quick.so.6
#3  ??? () at /lib64/libQt6Quick.so.6
#4  QObjectPrivate::deleteChildren() () at /lib64/libQt6Core.so.6
#5  QObject::~QObject() () at /lib64/libQt6Core.so.6
#6  ??? () at /lib64/libQt6Quick.so.6
#7  QObjectPrivate::deleteChildren() () at /lib64/libQt6Core.so.6
#8  QObject::~QObject() () at /lib64/libQt6Core.so.6
#9  ??? () at /lib64/libQt6QuickTemplates2.so.6        <- StackView (mainStack)
#10 QObjectPrivate::deleteChildren() () at /lib64/libQt6Core.so.6
#11 QObject::~QObject() () at /lib64/libQt6Core.so.6
#12-#18 (QQuickItem / QObject destructor chain)
#19 QQuickView::~QQuickView() () at /lib64/libQt6Quick.so.6
#20 QQuickView::~QQuickView() () at /lib64/libQt6Quick.so.6
#21 ??? () (kscreenlocker_greet: ~UnlockApp -> qDeleteAll(m_views))
#22 ??? ()
#23 __libc_start_call_main () at /lib64/libc.so.6

Without the debug logging the crash shows in the journal as a general
protection fault
in libc.so.6 (__memmove_avx_unaligned_erms) in kscreenlocker_g.

The only item view in the lock screen tree is the UserList ListView inside
MainBlock,
so this looks like a destruction-order problem between that ListView and its
model /
change listeners during ~QQuickView in Qt 6.12.

WORKAROUND (confirmed working)
A local copy of the org.kde.plasma.desktop shell package with this change in
contents/lockscreen/LockScreenUi.qml — detach the user list model while the
process is
still alive, then quit after a short delay:

    function safeQuit() {
        mainBlock.userListModel = null;
        safeQuitTimer.start();
    }
    Timer { id: safeQuitTimer; interval: 150; onTriggered: Qt.quit() }

    function onSucceeded() {
        if (!lockScreenUi.expectingPrompt || authenticator.hadPrompt) {
            lockScreenUi.safeQuit();
        } else { ... }
    }

With this, real lock/unlock cycles no longer crash. This suggests either the
greeter should
clear the model before destroying the views, or there is a Qt 6.12 regression
in
QQuickItemView destruction that should be forwarded to Qt.

Things ruled out: PAM fingerprint/smartcard modules (stubbed with pam_deny,
still crashes),
the greeter cache (~/.cache/kscreenlocker_greet moved away, still crashes),
monitor
hot-plug (connector stays "connected" thanks to a forced EDID), SELinux (no
AVCs).

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed
KDE Plasma Version: 6.8.0 (kscreenlocker6-6.8.0-2.1, kwin6-6.8.0-1.2,
plasma6-desktop-6.8.0-1.2)
Qt Version: 6.12.0 (libQt6Quick6-6.12.0-1.1)
Kernel Version: 7.2.11-1-default (64-bit)
Graphics Platform: Wayland
Graphics: Intel Arc (integrated), single HDMI monitor

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to