Bug 477949 - kwin_wayland crashed after changes in shortcut KCM
Summary: kwin_wayland crashed after changes in shortcut KCM
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-02 21:26 UTC by Nicolas Fella
Modified: 2023-12-13 21:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2023-12-02 21:26:43 UTC
STEPS TO REPRODUCE
1. Go to shortcuts KCM 
2. Add new > Command or Script
3. "Add" without adding any text for the command

OBSERVED RESULT
#0  0x00007f53c1fe9a71 in Component::activateGlobalShortcutContext(QString const&) (this=this@entry=0x0, uniqueName=...)
    at /home/nico/kde/src/kglobalacceld/src/component.cpp:72
#1  0x00007f53c1fd9f44 in KGlobalAccelDPrivate::component(QList<QString> const&) const (this=this@entry=0x1d7aff0, actionId=...)
    at /home/nico/kde/src/kglobalacceld/src/kglobalacceld.cpp:119
#2  0x00007f53c1fdaf9c in KGlobalAccelDPrivate::addAction(QList<QString> const&) (this=0x1d7aff0, actionId=...)
    at /home/nico/kde/src/kglobalacceld/src/kglobalacceld.cpp:141
#3  0x00007f53c1fdc741 in KGlobalAccelD::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_a=0x7fffeacabbb8, _id=11, _c=QMetaObject::InvokeMetaMethod, _o=0x1d71b50)
    at /home/nico/kde/build/kglobalacceld/src/KGlobalAccelD_autogen/include/moc_kglobalacceld.cpp:378
#4  KGlobalAccelD::qt_metacall(QMetaObject::Call, int, void**) (this=0x1d71b50, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fffeacabbb8)
    at /home/nico/kde/build/kglobalacceld/src/KGlobalAccelD_autogen/include/moc_kglobalacceld.cpp:446
#5  0x00007f53c038276a in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QList<QMetaType> const&, int)
    (this=this@entry=0x7f53a80016a0, object=object@entry=0x1d71b50, msg=..., metaTypes=..., slotIdx=16)
    at /home/nico/workspace/qt6/qtbase/src/dbus/qdbusintegrator.cpp:977
#6  0x00007f53c03861c0 in QDBusConnectionPrivate::activateCall(QObject*, int, QDBusMessage const&)
    (this=this@entry=0x7f53a80016a0, object=0x1d71b50, flags=240, msg=...) at /home/nico/workspace/qt6/qtbase/src/dbus/qdbusintegrator.cpp:886
#7  0x00007f53c0386697 in QDBusConnectionPrivate::activateCall(QObject*, int, QDBusMessage const&)
    (msg=..., flags=<optimized out>, object=<optimized out>, this=0x7f53a80016a0) at /home/nico/workspace/qt6/qtbase/src/dbus/qdbusintegrator.cpp:825
#8  QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int)
    (this=0x7f53a80016a0, node=..., msg=..., pathStartPos=<optimized out>) at /home/nico/workspace/qt6/qtbase/src/dbus/qdbusintegrator.cpp:1484
#9  0x00007f53c0388d3e in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f53a80251b0) at /home/nico/workspace/qt6/qtbase/src/dbus/qdbusintegrator.cpp:1580
#10 0x00007f53bfda6ae4 in QObject::event(QEvent*) (this=0x1d71b50, e=0x7f53a80251b0) at /home/nico/workspace/qt6/qtbase/src/corelib/kernel/qobject.cpp:1437
#11 0x00007f53c0f7fa11 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x1d71b50, e=0x7f53a80251b0)
    at /home/nico/workspace/qt6/qtbase/src/widgets/kernel/qapplication.cpp:3296
#12 0x00007f53bfd59cc8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x1d71b50, event=0x7f53a80251b0)
    at /home/nico/workspace/qt6/qtbase/src/corelib/kernel/qcoreapplication.cpp:1121
#13 0x00007f53bfd59e49 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>)
    at /home/nico/workspace/qt6/qtbase/src/corelib/kernel/qcoreapplication.cpp:1539
#14 0x00007f53bfd5d567 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
    (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=data@entry=0x1abc730)
    at /home/nico/workspace/qt6/qtbase/src/corelib/kernel/qcoreapplication.cpp:1901
#15 0x00007f53bfeebac1 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x1acd880, flags=...)
    at /home/nico/workspace/qt6/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:432
#16 0x00007f53c0aaaf3d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...)
    at /home/nico/workspace/qt6/qtbase/src/gui/platform/unix/qunixeventdispatcher.cpp:27
#17 0x00007f53bfd6584b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffeacac2f0, flags=..., flags@entry=...)
    at /home/nico/workspace/qt6/qtbase/src/corelib/global/qflags.h:34
#18 0x00007f53bfd62252 in QCoreApplication::exec() () at /home/nico/workspace/qt6/qtbase/src/corelib/global/qflags.h:74
#19 0x00007f53c05b071c in QGuiApplication::exec() () at /home/nico/workspace/qt6/qtbase/src/gui/kernel/qguiapplication.cpp:1925
#20 0x00007f53c0f7f985 in QApplication::exec() () at /home/nico/workspace/qt6/qtbase/src/widgets/kernel/qapplication.cpp:2574
#21 0x0000000000440fbe in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/nico/kde/src/kwin/src/main_wayland.cpp:609

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 6.6

ADDITIONAL INFORMATION
Of course the UI should prevent adding something if the text is empty, but kwin should not crash in any case
Comment 1 Nate Graham 2023-12-05 19:29:52 UTC
Git commit 35d141b7112204ee4f4cc6ccc16118754b86c114 by Nate Graham.
Committed on 05/12/2023 at 20:29.
Pushed by ngraham into branch 'master'.

kcms/keys: don't allow adding empty command

M  +1    -0    kcms/keys/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/35d141b7112204ee4f4cc6ccc16118754b86c114
Comment 2 Bug Janitor Service 2023-12-13 14:09:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/28
Comment 3 Vlad Zahorodnii 2023-12-13 21:30:31 UTC
Git commit ab15af3a27b83b3f5e00bca5515efdbd5c56f3f1 by Vlad Zahorodnii.
Committed on 13/12/2023 at 22:29.
Pushed by vladz into branch 'master'.

Fix a potential crash when registering an action

GlobalShortcutsRegistry::createServiceActionComponent() may return
nullptr if it's fed bad data.

M  +7    -5    src/kglobalacceld.cpp

https://invent.kde.org/plasma/kglobalacceld/-/commit/ab15af3a27b83b3f5e00bca5515efdbd5c56f3f1