| Summary: | plasmashell crashes when applying a layout template loading a nonexistent panel | ||
|---|---|---|---|
| Product: | [Plasma] plasmashell | Reporter: | Nia Bergvatn <nia.bergvatn> |
| Component: | Scripting | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | kdedev, nate, notmart |
| Priority: | NOR | ||
| Version First Reported In: | 6.5.5 | ||
| Target Milestone: | 1.0 | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/-/commit/82a69b3dfb7d38794b8c023f3f9e7954b32266db | Version Fixed/Implemented In: | 6.6.0 |
| Sentry Crash Report: | |||
| Attachments: | Layout template to test with. | ||
Can reproduce with the attached layout A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6249 Git commit 89af48b4544ad2db1f2b7cb93cb8d17d5dcba7f7 by Marco Martin. Committed on 02/02/2026 at 14:49. Pushed by mart into branch 'master'. Scripting: don't crash when trying to create invalid panels ScriptEngine::createContainment will return nullptr and will *not* create the containment when a non existent plugin is passed. therefore createContainmentWrapper need to be guarded for it, or scripts can crash plasmashell To test it, try to create a panel layout with the template attached on bug 515385 M +4 -0 shell/scripting/scriptengine.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/89af48b4544ad2db1f2b7cb93cb8d17d5dcba7f7 Git commit 82a69b3dfb7d38794b8c023f3f9e7954b32266db by Marco Martin. Committed on 02/02/2026 at 14:50. Pushed by mart into branch 'Plasma/6.6'. Scripting: don't crash when trying to create invalid panels ScriptEngine::createContainment will return nullptr and will *not* create the containment when a non existent plugin is passed. therefore createContainmentWrapper need to be guarded for it, or scripts can crash plasmashell To test it, try to create a panel layout with the template attached on bug 515385 (cherry picked from commit 89af48b4544ad2db1f2b7cb93cb8d17d5dcba7f7) 75ab6cdc Scripting: don't crash when trying to create invalid panels Co-authored-by: Marco Martin <notmart@gmail.com> M +4 -0 shell/scripting/scriptengine.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/82a69b3dfb7d38794b8c023f3f9e7954b32266db |
Created attachment 189134 [details] Layout template to test with. SUMMARY Layout templates can specify which panel to use, including custom panels. If the requested panel is not installed, plasmashell will crash. The behavior is not observed when changing "example.nia.badpanel" to "org.kde.panel" in the attached layout template. I encountered this behavior when installing a theme that had a custom layout template and panel. I had forgotten to install its panel, so plasmashell crashed, and it was not clear why it had done so. STEPS TO REPRODUCE 1. Extract the attached "example.nia.badlayout.zip" to ~/.local/share/plasma/layout-templates. 2. Right-click an existing panel in Plasma and choose "Show Panel Configuration". 3. Click "Add Panel". 4. Click "Bad Layout" from the dropdown. OBSERVED RESULT plasmashell crashes and the layout template is not applied. EXPECTED RESULT A gentler handler appears ("Sorry, the layout template could not be applied because...") SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.5.5 KDE Frameworks Version: 6.22.0 Qt Version: 6.10.2 Kernel Version: 6.18.7-arch1-1 (64-bit) ADDITIONAL INFORMATION Thread 1 (Thread 0x7f0e8f162b80 (LWP 842)): [KCrash Handler] #4 0x00007f0e9877745b in QObject::parent (this=<optimized out>, this=<optimized out>) at /usr/include/qt6/QtCore/qobject.h:348 #5 Plasma::Containment::corona (this=this@entry=0x0) at /usr/src/debug/libplasma/libplasma-6.5.5/src/plasma/containment.cpp:288 #6 0x0000558caf3f2996 in WorkspaceScripting::Containment::Containment (this=<optimized out>, containment=<optimized out>, engine=<optimized out>, this=<optimized out>, containment=<optimized out>, engine=<optimized out>) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/containment.cpp:44 #7 0x0000558caf3fd8c4 in WorkspaceScripting::ScriptEngine::createContainmentWrapper (this=0x558ce268e930, type=..., plugin=...) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/scriptengine.cpp:393 #8 0x0000558caf3fe1ea in WorkspaceScripting::ScriptEngine::V1::createContainment (this=this@entry=0x558ce174e4a0, type=..., defaultPlugin=..., plugin=...) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/scriptengine_v1.cpp:832 #9 0x0000558caf3fe2bc in WorkspaceScripting::ScriptEngine::V1::newPanel (this=this@entry=0x558ce174e4a0, plugin=...) at /usr/include/c++/15.2.1/utility:114 #10 0x0000558caf4049d3 in WorkspaceScripting::ScriptEngine::V1::qt_static_metacall (_o=_o@entry=0x558ce174e4a0, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=49, _a=_a@entry=0x7fff98fdb188) at /usr/src/debug/plasma-workspace/build/shell/plasmashell_autogen/include/moc_scriptengine_v1.cpp:378 #11 0x0000558caf407417 in WorkspaceScripting::ScriptEngine::V1::qt_metacall (this=0x558ce174e4a0, _c=<optimized out>, _id=49, _a=0x7fff98fdb188) at /usr/src/debug/plasma-workspace/build/shell/plasmashell_autogen/include/moc_scriptengine_v1.cpp:542 #12 0x00007f0e97336d03 in QQmlObjectOrGadget::metacall (this=<optimized out>, type=<optimized out>, index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/qml/qqmlobjectorgadget.cpp:14 #13 0x00007f0e971e6d51 in QV4::CallMethod (object=..., index=<optimized out>, returnType=..., argCount=<optimized out>, argTypes=<optimized out>, engine=<optimized out>, callArgs=<optimized out>, callType=<optimized out>) at /usr/include/qt6/QtCore/qvarlengtharray.h:90 #14 QV4::QObjectMethod::callPrecise (object=..., data=..., engine=<optimized out>, callArgs=<optimized out>, callType=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:2085 #15 0x00007f0e971f0b95 in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3117 #16 operator()<QV4::QObjectMethod::callInternal(const QV4::Value*, const QV4::Value*, int) const::<lambda()> > (__closure=<synthetic pointer>, call=...) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3094 #17 QV4::QObjectMethod::callInternal (this=0x7f0d837bf620, thisObject=<optimized out>, argv=0x7f0d837bf5b8, argc=1) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3117 #18 0x00007f0e9720e7eb in QV4::Runtime::CallName::call (engine=0x7f0e1bee5bd0, nameIndex=5, argv=0x7f0d837bf5b8, argc=1) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4runtime.cpp:1511 #19 0x00007f0e9724a842 in QV4::Moth::VME::interpret (frame=0x0, frame@entry=0x7fff98fdba20, engine=0x7f0e1bee5bd0, code=0x558ce197d020 "\002") at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:821 #20 0x00007f0e9724e2c6 in QV4::Moth::VME::exec (frame=<optimized out>, engine=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:493 #21 0x00007f0e971a3946 in QV4::ScriptFunction::virtualCallAsConstructor (fo=<optimized out>, argv=0x7f0d837bf540, argc=<optimized out>, newTarget=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4functionobject.cpp:476 #22 0x00007f0e97249d5f in QV4::Moth::VME::interpret (frame=0x0, frame@entry=0x7fff98fdbf40, engine=0x7f0e1bee5bd0, code=0x558cdd7abb42 "\030\006\002") at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:325 #23 0x00007f0e9724e2c6 in QV4::Moth::VME::exec (frame=<optimized out>, engine=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:493 #24 0x00007f0e97196300 in QV4::doCall (self=<optimized out>, thisObject=<optimized out>, argv=<optimized out>, argc=<optimized out>, context=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4function.cpp:53 #25 0x00007f0e97217e63 in QV4::Script::run (this=<optimized out>, thisObject=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4script.cpp:123 #26 0x00007f0e97139e9e in QJSEngine::evaluate (this=this@entry=0x558ce268e930, program=..., fileName=..., lineNumber=lineNumber@entry=1, exceptionStackTrace=exceptionStackTrace@entry=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsapi/qjsengine.cpp:531 #27 0x0000558caf3f8ff2 in WorkspaceScripting::ScriptEngine::evaluateScript (this=0x558ce268e930, script=..., path=...) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/scriptengine.cpp:240 #28 0x0000558caf406a26 in WorkspaceScripting::ScriptEngine::V1::loadTemplate (this=0x558ce268e930, layout=...) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/scriptengine_v1.cpp:576 #29 WorkspaceScripting::ScriptEngine::V1::loadTemplate (this=0x558ce268e930, layout=...) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/scriptengine_v1.cpp:502 #30 WorkspaceScripting::ScriptEngine::V1::qt_static_metacall (_o=_o@entry=0x558cdcf52c90, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=30, _a=_a@entry=0x7fff98fdc9c8) at /usr/src/debug/plasma-workspace/build/shell/plasmashell_autogen/include/moc_scriptengine_v1.cpp:342 #31 0x0000558caf407417 in WorkspaceScripting::ScriptEngine::V1::qt_metacall (this=0x558cdcf52c90, _c=<optimized out>, _id=30, _a=0x7fff98fdc9c8) at /usr/src/debug/plasma-workspace/build/shell/plasmashell_autogen/include/moc_scriptengine_v1.cpp:542 #32 0x00007f0e97336d03 in QQmlObjectOrGadget::metacall (this=<optimized out>, type=<optimized out>, index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/qml/qqmlobjectorgadget.cpp:14 #33 0x00007f0e971e6d51 in QV4::CallMethod (object=..., index=<optimized out>, returnType=..., argCount=<optimized out>, argTypes=<optimized out>, engine=<optimized out>, callArgs=<optimized out>, callType=<optimized out>) at /usr/include/qt6/QtCore/qvarlengtharray.h:90 #34 QV4::QObjectMethod::callPrecise (object=..., data=..., engine=<optimized out>, callArgs=<optimized out>, callType=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:2085 #35 0x00007f0e971f0b95 in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3117 #36 operator()<QV4::QObjectMethod::callInternal(const QV4::Value*, const QV4::Value*, int) const::<lambda()> > (__closure=<synthetic pointer>, call=...) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3094 #37 QV4::QObjectMethod::callInternal (this=0x7f0e003b9590, thisObject=<optimized out>, argv=0x7f0e003b9548, argc=1) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3117 #38 0x00007f0e9720e7eb in QV4::Runtime::CallName::call (engine=0x7f0e1bee5370, nameIndex=2, argv=0x7f0e003b9548, argc=1) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4runtime.cpp:1511 #39 0x00007f0e9724a842 in QV4::Moth::VME::interpret (frame=0x0, frame@entry=0x7fff98fdd230, engine=0x7f0e1bee5370, code=0x558cdccb3a3c "\030\006\002") at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:821 #40 0x00007f0e9724e2c6 in QV4::Moth::VME::exec (frame=<optimized out>, engine=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:493 #41 0x00007f0e97196300 in QV4::doCall (self=<optimized out>, thisObject=<optimized out>, argv=<optimized out>, argc=<optimized out>, context=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4function.cpp:53 #42 0x00007f0e97217e63 in QV4::Script::run (this=<optimized out>, thisObject=<optimized out>) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsruntime/qv4script.cpp:123 #43 0x00007f0e97139e9e in QJSEngine::evaluate (this=this@entry=0x7fff98fdd7d0, program=..., fileName=..., lineNumber=lineNumber@entry=1, exceptionStackTrace=exceptionStackTrace@entry=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative/src/qml/jsapi/qjsengine.cpp:531 #44 0x0000558caf3f8ff2 in WorkspaceScripting::ScriptEngine::evaluateScript (this=0x7fff98fdd7d0, script=..., path=...) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/scripting/scriptengine.cpp:240 #45 0x0000558caf3b399f in ShellCorona::addPanel (this=0x7fff98fdeec0, action=<optimized out>) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/shellcorona.cpp:2346 #46 0x00007f0e95dd8f0f in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:461 #47 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4272 #48 0x00007f0e9811b047 in QMetaObject::activate<void, QAction*> (sender=0x558cddf717b0, mo=<optimized out>, local_signal_index=2, ret=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:319 #49 QMenu::triggered (this=0x558cddf717b0, _t1=0x558cdccbde70) at /usr/src/debug/qt6-base/build/src/widgets/Widgets_autogen/include/moc_qmenu.cpp:235 #50 QMenuPrivate::_q_actionTriggered (this=0x558cddeed090) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qmenu.cpp:1517 #51 QMenu::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/qt6-base/build/src/widgets/Widgets_autogen/include/moc_qmenu.cpp:123 #52 0x00007f0e95dd92da in doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4284 #53 0x00007f0e96a1b165 in QMetaObject::activate<void, bool> (sender=<optimized out>, mo=<optimized out>, local_signal_index=<optimized out>, ret=<optimized out>, sender=<optimized out>, mo=<optimized out>, local_signal_index=<optimized out>, ret=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:319 #54 QAction::triggered (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/qt6-base/build/src/gui/Gui_autogen/include/moc_qaction.cpp:374 #55 QAction::activate (this=0x558cdccbde70, event=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qaction.cpp:1104 #56 0x00007f0e98109f2d in QMenuPrivate::activateCausedStack (this=0x558cddeed090, causedStack=..., action=0x558cdccbde70, action_e=QAction::Trigger, self=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qmenu.cpp:1409 #57 0x00007f0e9810e7e8 in QMenuPrivate::activateAction (this=0x558cddeed090, action=0x558cdccbde70, action_e=QAction::Trigger, self=true) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qmenu.cpp:1491 #58 0x00007f0e97f5e487 in QWidget::event (this=0x558cddf717b0, event=0x7fff98fde280) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qwidget.cpp:9001 #59 0x00007f0e97f03380 in QApplicationPrivate::notify_helper (this=this@entry=0x558cdc10ebe0, receiver=receiver@entry=0x558cddf717b0, e=e@entry=0x7fff98fde280) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3305 #60 0x00007f0e97f04df7 in QApplication::notify (this=<optimized out>, receiver=0x558cddf717b0, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2785 #61 0x00007f0e95d6bf48 in QCoreApplication::notifyInternal2 (receiver=0x558cddf717b0, event=0x7fff98fde280) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1109 #62 0x00007f0e95d6bf9d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1563 #63 0x00007f0e97ef9228 in QApplicationPrivate::sendMouseEvent (receiver=0x558cddf717b0, event=0x7fff98fde280, alienWidget=<optimized out>, nativeWidget=0x558cddf717b0, buttonDown=0x7f0e9854b730 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2366 #64 0x00007f0e97f78d0f in QWidgetWindow::handleMouseEvent (this=0x558ce0146bb0, event=event@entry=0x7fff98fde620) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qwidgetwindow.cpp:578 #65 0x00007f0e97f797db in QWidgetWindow::event (this=<optimized out>, event=0x7fff98fde620) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qwidgetwindow.cpp:293 #66 0x00007f0e97f03380 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x558ce0146bb0, e=0x7fff98fde620) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3305 #67 0x00007f0e95d6bf48 in QCoreApplication::notifyInternal2 (receiver=0x558ce0146bb0, event=0x7fff98fde620) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1109 #68 0x00007f0e95d6bf9d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1563 #69 0x00007f0e965a7fa8 in QGuiApplicationPrivate::processMouseEvent (e=0x7f0e80007390) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qguiapplication.cpp:2474 #70 0x00007f0e9662c3ac in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1117 #71 0x00007f0e96b33cd4 in userEventSourceDispatch (source=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:39 #72 0x00007f0e948a7f8d in g_main_dispatch (context=0x7f0e88000f60) at ../glib/glib/gmain.c:3565 #73 0x00007f0e948a9657 in g_main_context_dispatch_unlocked (context=0x7f0e88000f60) at ../glib/glib/gmain.c:4425 #74 g_main_context_iterate_unlocked (context=context@entry=0x7f0e88000f60, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4490 #75 0x00007f0e948a9865 in g_main_context_iteration (context=0x7f0e88000f60, may_block=1) at ../glib/glib/gmain.c:4556 #76 0x00007f0e9604fcb2 in QEventDispatcherGlib::processEvents (this=0x558cdc1168e0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399 #77 0x00007f0e95d76cf6 in QEventLoop::processEvents (this=0x7fff98fdeaf0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104 #78 QEventLoop::exec (this=0x7fff98fdeaf0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186 #79 0x00007f0e95d709f1 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1452 #80 0x00007f0e97efe4ea in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2575 #81 0x0000558caf3712d9 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/plasma-workspace/plasma-workspace-6.5.5/shell/main.cpp:188