Bug 407653 - Screen locker can't load cursor theme on Wayland
Summary: Screen locker can't load cursor theme on Wayland
Status: RESOLVED FIXED
Alias: None
Product: kscreenlocker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: wayland
: 407751 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-17 16:33 UTC by Matej Mrenica
Modified: 2021-05-21 09:11 UTC (History)
8 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 Matej Mrenica 2019-05-17 16:33:52 UTC
SUMMARY
Only on Wayland

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.15.90
KDE Frameworks Version: 5.58
Qt Version: 5.13.0 beta3
Mesa Version: 19.0.4
Linux Kernel Version: 5.1.3
Comment 1 Patrick Silva 2019-05-18 00:05:22 UTC
I can confirm on Arch running plasma 5.16 beta.
Comment 2 Antonio Rojas 2019-05-18 11:14:06 UTC
Backtrace:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  QMap<QtWaylandClient::QWaylandCursorTheme::WaylandCursor, wl_cursor*>::value (adefaultValue=<optimized out>, 
    akey=@0x7ffc221da65c: QtWaylandClient::QWaylandCursorTheme::ArrowCursor, this=0x8) at /usr/include/qt/QtCore/qmap.h:656
656     Q_INLINE_TEMPLATE const T QMap<Key, T>::value(const Key &akey, const T &adefaultValue) const
[Current thread is 1 (Thread 0x7fcc1e4e0800 (LWP 1787))]
(gdb) bt
#0  QMap<QtWaylandClient::QWaylandCursorTheme::WaylandCursor, wl_cursor*>::value (adefaultValue=<optimized out>, 
    akey=@0x7ffc221da65c: QtWaylandClient::QWaylandCursorTheme::ArrowCursor, this=0x8) at /usr/include/qt/QtCore/qmap.h:656
#1  QtWaylandClient::QWaylandCursorTheme::requestCursor (this=0x0, shape=QtWaylandClient::QWaylandCursorTheme::ArrowCursor)
    at /build/qt5-wayland/src/qtwayland-everywhere-src-5.13.0-beta3/src/client/qwaylandcursor.cpp:75
#2  0x00007fcc1de7f554 in QtWaylandClient::QWaylandCursorTheme::cursorImage (this=<optimized out>, shape=shape@entry=Qt::ArrowCursor)
    at /build/qt5-wayland/src/qtwayland-everywhere-src-5.13.0-beta3/src/client/qwaylandcursor.cpp:217
#3  0x00007fcc1de424dd in QtWaylandClient::QWaylandInputDevice::Pointer::updateCursorTheme (this=this@entry=0x564713d715f0)
    at /build/qt5-wayland/src/qtwayland-everywhere-src-5.13.0-beta3/src/client/qwaylandinputdevice.cpp:263
#4  0x00007fcc1de44ec9 in QtWaylandClient::QWaylandInputDevice::Pointer::updateCursor (this=this@entry=0x564713d715f0)
    at /build/qt5-wayland/src/qtwayland-everywhere-src-5.13.0-beta3/src/client/qwaylandinputdevice.cpp:299
#5  0x00007fcc1de458b5 in QtWaylandClient::QWaylandInputDevice::Pointer::pointer_enter (this=0x564713d715f0, serial=347, surface=<optimized out>, 
    sx=<optimized out>, sy=29184) at /build/qt5-wayland/src/qtwayland-everywhere-src-5.13.0-beta3/src/client/qwaylandinputdevice.cpp:553
#6  0x00007fcc1de8703f in QtWayland::wl_pointer::handle_enter (data=<optimized out>, object=<optimized out>, serial=<optimized out>, 
    surface=<optimized out>, surface_x=<optimized out>, surface_y=<optimized out>) at qwayland-wayland.cpp:1509
#7  0x00007fcc221fd6d0 in ffi_call_unix64 () from /usr/lib/libffi.so.6
#8  0x00007fcc221fd0a0 in ffi_call () from /usr/lib/libffi.so.6
#9  0x00007fcc246c6f8f in ?? () from /usr/lib/libwayland-client.so.0
#10 0x00007fcc246c36ba in ?? () from /usr/lib/libwayland-client.so.0
#11 0x00007fcc246c4bfc in wl_display_dispatch_queue_pending () from /usr/lib/libwayland-client.so.0
#12 0x00007fcc1de49ca2 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x564713d6de50)
    at /build/qt5-wayland/src/qtwayland-everywhere-src-5.13.0-beta3/src/client/qwaylanddisplay.cpp:193
#13 0x00007fcc1de89986 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, 
    _a=<optimized out>) at .moc/moc_qwaylanddisplay_p.cpp:77
#14 0x00007fcc230af4b7 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#15 0x00007fcc230d9c21 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#16 0x00007fcc1debe290 in QPAEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at qeventdispatcher_glib.cpp:120
#17 0x00007fcc2308317c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#18 0x00007fcc2308b3e6 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#19 0x00005647138b2881 in ?? ()
#20 0x00007fcc22acbce3 in __libc_start_main () from /usr/lib/libc.so.6
#21 0x00005647138b2b6e in _start ()
Comment 3 Antonio Rojas 2019-05-18 11:28:57 UTC
This is also reproducible with 5.15.5, so actually a Qt 5.13 issue
Comment 4 Matej Mrenica 2019-05-18 11:33:18 UTC
(In reply to Antonio Rojas from comment #3)
> This is also reproducible with 5.15.5, so actually a Qt 5.13 issue

Yes, I also remember having this issue before Plasma 5.15.90.
Comment 5 Fabian Vogt 2019-05-18 13:50:29 UTC
The backtrace points to https://github.com/qt/qtwayland/commit/021bd4d7ed1f4221a0132e21ef0ee5b07f74be3e being involved. I currently don't have a system with Qt 5.13 and Plasma wayland, so I can't test it myself now.
Comment 6 Antonio Rojas 2019-05-18 15:23:57 UTC
(In reply to Fabian Vogt from comment #5)
> The backtrace points to
> https://github.com/qt/qtwayland/commit/
> 021bd4d7ed1f4221a0132e21ef0ee5b07f74be3e being involved. I currently don't
> have a system with Qt 5.13 and Plasma wayland, so I can't test it myself now.

Not that one, it's actually https://github.com/qt/qtwayland/commit/15b3afd621a5c0e8d1dd1cd9d5ae816e15aa4a1a
Comment 7 Antonio Rojas 2019-05-20 10:52:58 UTC
*** Bug 407751 has been marked as a duplicate of this bug. ***
Comment 8 Antonio Rojas 2019-05-20 10:53:32 UTC
Reported upstream https://bugreports.qt.io/browse/QTBUG-75920
Comment 9 Matej Mrenica 2019-05-20 11:00:28 UTC
(In reply to Antonio Rojas from comment #8)
> Reported upstream https://bugreports.qt.io/browse/QTBUG-75920

Would it be possible for you to create a (temporary) patch/workaround for Arch?
Comment 10 David Edmundson 2019-05-20 11:08:18 UTC
I have one on phab
Comment 11 Matej Mrenica 2019-05-20 12:41:24 UTC
(In reply to David Edmundson from comment #10)
> I have one on phab

Could you share it here?
Comment 12 Antonio Rojas 2019-05-21 08:08:27 UTC
The crash is fixed upstream with https://codereview.qt-project.org/c/qt/qtwayland/+/262349

However, the Plasma issue that was triggering the crash still holds: the screen locker seems to be requesting an invalid cursor size. So, when locking the screen, the cursor is stuck to the last one that was in use (and doesn't change when hovering the password field).

Should we leave this open to track this issue or use a separate report?
Comment 13 David Edmundson 2019-05-21 09:52:02 UTC
Ignore my comment above, I was mixing up the SDDM crash which was QML related in upstream Qt.

Yes, lets leave this open as best case with the Qt fix we still have an incorrect cursor theme. It probably means an env argument isn't being forwarded in kwin's custom spawning.
Comment 14 David Edmundson 2019-05-22 17:22:07 UTC
Our seccomp filter is blocking something in wl_cursor_theme_load
Comment 15 Matej Mrenica 2019-07-17 09:16:23 UTC
Is this problem still happening?
Comment 16 Antonio Rojas 2019-07-17 09:31:44 UTC
(In reply to mthw0 from comment #15)
> Is this problem still happening?

See comment #13
Comment 17 David Edmundson 2019-07-17 09:50:42 UTC
> However, the Plasma issue that was triggering the crash still holds: the screen locker seems to be requesting an invalid cursor size


It is us at fault. It's the "security filter". Wayland cursors try to open via shm, that gets blocked and then it aborts.
Comment 18 David Edmundson 2021-05-21 09:11:47 UTC
This is implicitly fixed by us removing that security filter