Bug 370422 - kscreenlocker crashes when unlocking the session after resume from s2ram
Summary: kscreenlocker crashes when unlocking the session after resume from s2ram
Status: RESOLVED UPSTREAM
Alias: None
Product: kscreenlocker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-10 18:31 UTC by Christian Trippe
Modified: 2016-11-24 20:21 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Trippe 2016-10-10 18:31:15 UTC
Starting with plasma 5.8 I cannot unlock my laptop after resume from suspend (s2ram). After typing the password and unlocking the session, the locked screen reappears after a few a few seconds. I did not have the problem with plasma 5.7.x

Switching the another virtual terminal (Ctrl+Alt+F1), I find the following in ~/.xsession-errors-:0

UnmapNotify: 134217739
UnmapNotify: 134217739
KCrash: Application 'kscreenlocker_greet' crashing...
CreateNotify: 134217731
CreateNotify: 134217735
CreateNotify: 134217737
CreateNotify: 134217739
CreateNotify: 134217741
MapNotify: 134217739
uhoh! duplicate!
uhoh! duplicate!
CreateNotify: 134217743
powerdevil: ACTIVE SESSION PATH CHANGED: "/"

Unlocking with loginctl unlock-session 1 from such a terminal successfully unlocks the session.

The crash is always reproducible.

Reproducible: Always

Steps to Reproduce:
1. Suspend your laptop via lidclose
2. open the lid, the laptop resumes
3. Enter password and unlock

Actual Results:  
The lockscreen comes back.

Expected Results:  
Login to the running plasma session.

If you give me some hints, I can try to produce a proper backtrace.
Comment 1 Martin Flöser 2016-10-11 05:14:37 UTC
Getting the backtrace might be tricky. kscreenlocker_greet disables ptrace and thus we don't get any coredump handler running.

You could try to run kscreenlocker_greet manually with --testing. Maybe the problem also happens there. From what I understand it seems to crash once you enter the password. So ideally that also happens in testing mode.
Comment 2 Manfred Kitzbichler 2016-10-11 14:46:50 UTC
Same here. I just did a zypper dup to the newest Tumbleweed repository with Plasma 5.8 and Qt 5.7 and I am getting a crash everytime. Also when starting the greeter manually from the console as suggested by Martin. GDB says it crashes in libQtQuick5.so:

Thread 1 "kscreenlocker_g" received signal SIGSEGV, Segmentation fault.
0x00007ffff5de07ff in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
Comment 3 Manfred Kitzbichler 2016-10-11 15:18:01 UTC
Here is a hopefully more informative backtrace:

#0  0x00007ffff5de07ff in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#1  0x00007ffff5dfb396 in ?? () from /usr/lib64/libQt5Quick.so.5
#2  0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#3  0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#4  0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#5  0x00007ffff5dfbb06 in ?? () from /usr/lib64/libQt5Quick.so.5
#6  0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#7  0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#8  0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#9  0x00007ffff5dfb396 in ?? () from /usr/lib64/libQt5Quick.so.5
#10 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#11 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#12 0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#13 0x00007fffdeb85c26 in ?? ()
#14 0x000000000098c5f0 in ?? ()
#15 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#16 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#17 0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#18 0x00007ffff5dfbea6 in ?? () from /usr/lib64/libQt5Quick.so.5
#19 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#20 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#21 0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#22 0x00007ffff5dfbb06 in ?? () from /usr/lib64/libQt5Quick.so.5
#23 0x00007ffff6baf548 in KDeclarative::QmlObject::~QmlObject() () from /usr/lib64/libKF5Declarative.so.5
#24 0x00007ffff6bb00a9 in KDeclarative::QmlObjectSharedEngine::~QmlObjectSharedEngine() () from /usr/lib64/libKF5Declarative.so.5
#25 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#26 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#27 0x00007ffff4ca91d9 in QWindow::~QWindow() () from /usr/lib64/libQt5Gui.so.5
#28 0x00007ffff5decb24 in QQuickWindow::~QQuickWindow() () from /usr/lib64/libQt5Quick.so.5
#29 0x00007ffff79ca319 in KQuickAddons::QuickViewSharedEngine::~QuickViewSharedEngine() () from /usr/lib64/libKF5QuickAddons.so.5
#30 0x000000000040d1ae in qDeleteAll<QList<KQuickAddons::QuickViewSharedEngine*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:323
#31 qDeleteAll<QList<KQuickAddons::QuickViewSharedEngine*> > (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:331
#32 ScreenLocker::UnlockApp::~UnlockApp (this=0x7fffffffdb60, __in_chrg=<optimized out>) at /usr/src/debug/kscreenlocker-5.8.0/greeter/greeterapp.cpp:118
#33 0x0000000000409ba0 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kscreenlocker-5.8.0/greeter/main.cpp:79
Comment 4 Martin Flöser 2016-10-11 15:28:58 UTC
could you please install debug symbols for Qt (declarative). For kscreenlocker it's there, but it's pretty down in the stack.
Comment 5 Manfred Kitzbichler 2016-10-11 16:00:05 UTC
Does this help?

#0  0x00007ffff5de07ff in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#1  0x00007ffff5dfb396 in ?? () from /usr/lib64/libQt5Quick.so.5
#2  0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#3  0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#4  0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#5  0x00007ffff5dfbb06 in ?? () from /usr/lib64/libQt5Quick.so.5
#6  0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#7  0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#8  0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#9  0x00007ffff5dfb396 in ?? () from /usr/lib64/libQt5Quick.so.5
#10 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#11 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#12 0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#13 0x00007fffdeb85c26 in ?? ()
#14 0x000000000098c370 in ?? ()
#15 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#16 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#17 0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#18 0x00007ffff5dfbea6 in ?? () from /usr/lib64/libQt5Quick.so.5
#19 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#20 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#21 0x00007ffff5de09f3 in QQuickItem::~QQuickItem() () from /usr/lib64/libQt5Quick.so.5
#22 0x00007ffff5dfbb06 in ?? () from /usr/lib64/libQt5Quick.so.5
#23 0x00007ffff6baf548 in KDeclarative::QmlObjectPrivate::~QmlObjectPrivate (this=0x6fd0d0, __in_chrg=<optimized out>)
    at /usr/src/debug/kdeclarative-5.26.0/src/kdeclarative/qmlobject.cpp:73
#24 KDeclarative::QmlObject::~QmlObject (this=0x6b0750, __in_chrg=<optimized out>) at /usr/src/debug/kdeclarative-5.26.0/src/kdeclarative/qmlobject.cpp:201
#25 0x00007ffff6bb00a9 in KDeclarative::QmlObjectSharedEngine::~QmlObjectSharedEngine (this=0x6b0750, __in_chrg=<optimized out>)
    at /usr/src/debug/kdeclarative-5.26.0/src/kdeclarative/qmlobjectsharedengine.cpp:79
#26 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#27 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#28 0x00007ffff4ca91d9 in QWindow::~QWindow() () from /usr/lib64/libQt5Gui.so.5
#29 0x00007ffff5decb24 in QQuickWindow::~QQuickWindow() () from /usr/lib64/libQt5Quick.so.5
#30 0x00007ffff79ca319 in KQuickAddons::QuickViewSharedEngine::~QuickViewSharedEngine() () from /usr/lib64/libKF5QuickAddons.so.5
#31 0x000000000040d1ae in qDeleteAll<QList<KQuickAddons::QuickViewSharedEngine*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:323
#32 qDeleteAll<QList<KQuickAddons::QuickViewSharedEngine*> > (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:331
#33 ScreenLocker::UnlockApp::~UnlockApp (this=0x7fffffffdb20, __in_chrg=<optimized out>) at /usr/src/debug/kscreenlocker-5.8.0/greeter/greeterapp.cpp:118
#34 0x0000000000409ba0 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kscreenlocker-5.8.0/greeter/main.cpp:79
Comment 6 Manfred Kitzbichler 2016-10-11 16:13:53 UTC
Just installed the whole >200MB libQtQuick5 debugsource. This is what I am getting:

(gdb) bt
#0  0x00007ffff5de07ff in QQuickItem::~QQuickItem (this=0xf58080, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2341
#1  0x00007ffff5dfb396 in QQmlPrivate::QQmlElement<QQuickFocusScope>::~QQmlElement (this=0xf58080, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#2  QQmlPrivate::QQmlElement<QQuickFocusScope>::~QQmlElement (this=0xf58080, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#3  0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#4  0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#5  0x00007ffff5de09f3 in QQuickItem::~QQuickItem (this=0xf74830, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2316
#6  0x00007ffff5dfbb06 in QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement (this=0xf74830, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#7  QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement (this=0xf74830, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#8  0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#9  0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#10 0x00007ffff5de09f3 in QQuickItem::~QQuickItem (this=0xfae9a0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2316
#11 0x00007ffff5dfb396 in QQmlPrivate::QQmlElement<QQuickFocusScope>::~QQmlElement (this=0xfae9a0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#12 QQmlPrivate::QQmlElement<QQuickFocusScope>::~QQmlElement (this=0xfae9a0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#13 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#14 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#15 0x00007ffff5de09f3 in QQuickItem::~QQuickItem (this=0xf88890, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2316
#16 0x00007fffdeb85c26 in ?? ()
#17 0x0000000000941710 in ?? ()
#18 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#19 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#20 0x00007ffff5de09f3 in QQuickItem::~QQuickItem (this=0x97bec0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2316
#21 0x00007ffff5dfbea6 in QQmlPrivate::QQmlElement<QQuickLoader>::~QQmlElement (this=0x97bec0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#22 QQmlPrivate::QQmlElement<QQuickLoader>::~QQmlElement (this=0x97bec0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#23 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#24 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#25 0x00007ffff5de09f3 in QQuickItem::~QQuickItem (this=0x9eaec0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2316
#26 0x00007ffff5dfbb06 in QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement (this=0x9eaec0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#27 QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement (this=0x9eaec0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/qml/qml/qqmlprivate.h:104
#28 0x00007ffff6baf548 in KDeclarative::QmlObjectPrivate::~QmlObjectPrivate (this=0x6fd140, __in_chrg=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /usr/src/debug/kdeclarative-5.26.0/src/kdeclarative/qmlobject.cpp:73
#29 KDeclarative::QmlObject::~QmlObject (this=0x6c9470, __in_chrg=<optimized out>) at /usr/src/debug/kdeclarative-5.26.0/src/kdeclarative/qmlobject.cpp:201
#30 0x00007ffff6bb00a9 in KDeclarative::QmlObjectSharedEngine::~QmlObjectSharedEngine (this=0x6c9470, __in_chrg=<optimized out>)
    at /usr/src/debug/kdeclarative-5.26.0/src/kdeclarative/qmlobjectsharedengine.cpp:79
#31 0x00007ffff47736d1 in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#32 0x00007ffff477ca4f in QObject::~QObject() () from /usr/lib64/libQt5Core.so.5
#33 0x00007ffff4ca91d9 in QWindow::~QWindow() () from /usr/lib64/libQt5Gui.so.5
#34 0x00007ffff5decb24 in QQuickWindow::~QQuickWindow (this=0x6944b0, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickwindow.cpp:1210
#35 0x00007ffff79ca319 in KQuickAddons::QuickViewSharedEngine::~QuickViewSharedEngine() () from /usr/lib64/libKF5QuickAddons.so.5
#36 0x000000000040d1ae in qDeleteAll<QList<KQuickAddons::QuickViewSharedEngine*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:323
#37 qDeleteAll<QList<KQuickAddons::QuickViewSharedEngine*> > (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:331
#38 ScreenLocker::UnlockApp::~UnlockApp (this=0x7fffffffdb20, __in_chrg=<optimized out>) at /usr/src/debug/kscreenlocker-5.8.0/greeter/greeterapp.cpp:118
#39 0x0000000000409ba0 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kscreenlocker-5.8.0/greeter/main.cpp:79
Comment 7 Manfred Kitzbichler 2016-10-11 16:17:48 UTC
This is the offending assignment:

Thread 1 "kscreenlocker_g" received signal SIGSEGV, Segmentation fault.
0x00007ffff5de07ff in QQuickItem::~QQuickItem (this=0xf58080, __in_chrg=<optimized out>)
    at /usr/src/debug/qtdeclarative-opensource-src-5.7.0/src/quick/items/qquickitem.cpp:2341
2341            QQuickAnchorsPrivate *anchor = change.listener->anchorPrivate();
Comment 8 Martin Flöser 2016-10-12 05:49:40 UTC
Thanks that backtrace looks good.
Comment 9 Manfred Kitzbichler 2016-10-12 12:45:32 UTC
I did some debugging with gdb and the code line in question is visited about two dozen times without problem. When it finally crashes that's presumably because the "listener" entry in the "change" structure has this rather peculiar value:

print *change.listener
$58 = {_vptr.QQuickItemChangeListener = 0x4545454545454545}
Comment 10 Manfred Kitzbichler 2016-10-16 01:23:40 UTC
For what it's worth, after I applied the patch below to my version of libqt5declarative the problem is gone. It also has the positive side effect, that plasmashell doesn't crash anymore at logout and probably there are quite a few other Qt applications that crashed occasionally because of this bug.

https://codereview.qt-project.org/#/c/170844/
Comment 11 Janek Bevendorff 2016-10-25 18:21:17 UTC
I have a similar issue. Since the last update I cannot unlock my session anymore (on the desktop). I try four times and then the lock screen tells me that I have to use loginctl unlock-sessions.

When I run kscreenlocker_greet manually, I unfortuantely only get a very useless stack trace and since I'm on arch, it's not that easy to install debug symbols, especially, when I don't really know for what package.

#0  0x00007ffff2df1ad0 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#1  0x00007fffdcdf2e1c in ?? () from /usr/lib/libGLX_nvidia.so.0
#2  0x00007fffdcdc9dc8 in ?? () from /usr/lib/libGLX_nvidia.so.0
#3  0x00007fffd8806e89 in ?? () from /usr/lib/libEGL.so.1
#4  0x00007ffff7de9ae8 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff3dce990 in __run_exit_handlers () from /usr/lib/libc.so.6
#6  0x00007ffff3dce9ea in exit () from /usr/lib/libc.so.6
#7  0x00007ffff3db9298 in __libc_start_main () from /usr/lib/libc.so.6
#8  0x000000000040946a in ?? ()
#9  0x00007fffffffe158 in ?? ()
#10 0x000000000000001c in ?? ()
#11 0x0000000000000003 in ?? ()
#12 0x00007fffffffe512 in ?? ()
#13 0x00007fffffffe52f in ?? ()
#14 0x00007fffffffe54c in ?? ()
#15 0x0000000000000000 in ?? ()

From the top part I would say this stack trace is different, but who knows... The bottom part, unfortunately, doesn't give any information about which packages need debug symbols.
Comment 12 David Edmundson 2016-10-25 20:32:57 UTC
>For what it's worth, after I applied the patch below to my version of libqt5declarative the problem is gone.

Fixed in Qt  5.6.2, 5.7.1 

Please reopen if you have this crash after upgrading to those Qt versions.