Bug 428481

Summary: System-settings crashes on opening various KCMs
Product: [Applications] systemsettings Reporter: Flaviano Matos <pehteimoso-kdebugs>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: ekaitz, jchevarley, kde, mentalfloss
Priority: NOR Keywords: drkonqi
Version: 5.19.5   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Flaviano Matos 2020-10-30 19:17:01 UTC
Application: systemsettings5 (5.19.5)

Qt Version: 5.15.1
Frameworks Version: 5.73.0
Operating System: Linux 5.6.6-300.fc32.x86_64 x86_64
Windowing system: X11
Distribution: Fedora 33 (Workstation Edition)

-- Information about the crash:
On opening the following KCMs (I am translating this from Portuguese, I couldn't get to set System-settings to English):
Plasma style
Window decoration
Fonts
Emoticons
Workspace behavior
Shortcuts
Desktop session
Krunner
Regional configuration
KDE Wallet
Connections
Compositor
Energy management
System-settings crashes everytime.

The crash can be reproduced every time.

-- Backtrace:
Application: Configurações do sistema (systemsettings5), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fb1f4203b4c in QQuickTransform::~QQuickTransform() () from /lib64/libQt5Quick.so.5
#6  0x00007fb1f436ab52 in QAccessibleQuickItem::role() const () from /lib64/libQt5Quick.so.5
#7  0x00007fb1e2c7177a in AtSpiAdaptor::pathForInterface(QAccessibleInterface*) const () from /lib64/libQt5XcbQpa.so.5
#8  0x00007fb1e2c73934 in AtSpiAdaptor::notifyStateChange(QAccessibleInterface*, QString const&, int) () from /lib64/libQt5XcbQpa.so.5
#9  0x00007fb1e2c74fd0 in AtSpiAdaptor::notify(QAccessibleEvent*) () from /lib64/libQt5XcbQpa.so.5
#10 0x00007fb1f420c7d8 in QQuickItemPrivate::setEffectiveVisibleRecur(bool) () from /lib64/libQt5Quick.so.5
#11 0x00007fb1f420c8b3 in QQuickItemPrivate::setVisible(bool) () from /lib64/libQt5Quick.so.5
#12 0x00007fb1cc03b836 in ContentItem::forgetItem(QQuickItem*) () from /usr/lib64/qt5/qml/org/kde/kirigami.2/libkirigamiplugin.so
#13 0x00007fb1cc03b918 in ContentItem::itemChange(QQuickItem::ItemChange, QQuickItem::ItemChangeData const&) () from /usr/lib64/qt5/qml/org/kde/kirigami.2/libkirigamiplugin.so
#14 0x00007fb1f420a5c5 in QQuickItemPrivate::itemChange(QQuickItem::ItemChange, QQuickItem::ItemChangeData const&) () from /lib64/libQt5Quick.so.5
#15 0x00007fb1f420f79f in QQuickItemPrivate::removeChild(QQuickItem*) () from /lib64/libQt5Quick.so.5
#16 0x00007fb1f420fadc in QQuickItem::setParentItem(QQuickItem*) () from /lib64/libQt5Quick.so.5
#17 0x00007fb1f4205356 in QQuickItem::~QQuickItem() () from /lib64/libQt5Quick.so.5
#18 0x00007fb1aeae6c25 in QQmlPrivate::QQmlElement<QQuickPage>::~QQmlElement() () from /usr/lib64/qt5/qml/QtQuick/Templates.2/libqtquicktemplates2plugin.so
#19 0x00007fb1f4532de8 in KDeclarative::QmlObject::~QmlObject() () from /lib64/libKF5Declarative.so.5
#20 0x00007fb1f4533079 in KDeclarative::QmlObjectSharedEngine::~QmlObjectSharedEngine() () from /lib64/libKF5Declarative.so.5
#21 0x00007fb1f618c562 in KQuickAddons::ConfigModule::~ConfigModule() () from /lib64/libKF5QuickAddons.so.5
#22 0x00007fb1ac4c46f3 in KCMWorkspaceOptions::~KCMWorkspaceOptions() () from /usr/lib64/qt5/plugins/kcms/kcm_workspace.so
#23 0x00007fb1f6288a87 in KCModuleQml::~KCModuleQml() () from /lib64/libKF5KCMUtils.so.5
#24 0x00007fb1f6288aad in KCModuleQml::~KCModuleQml() () from /lib64/libKF5KCMUtils.so.5
#25 0x00007fb1f628b9b8 in KCModuleProxy::deleteClient() () from /lib64/libKF5KCMUtils.so.5
#26 0x00007fb1f628d2dc in KCModuleProxy::~KCModuleProxy() () from /lib64/libKF5KCMUtils.so.5
#27 0x00007fb1f628d3dd in KCModuleProxy::~KCModuleProxy() () from /lib64/libKF5KCMUtils.so.5
#28 0x00007fb1f4d90a4a in QObjectPrivate::deleteChildren() () from /lib64/libQt5Core.so.5
#29 0x00007fb1f579b746 in QWidget::~QWidget() () from /lib64/libQt5Widgets.so.5
#30 0x00007fb1f579ba99 in QWidget::~QWidget() () from /lib64/libQt5Widgets.so.5
#31 0x00007fb1f4d90a4a in QObjectPrivate::deleteChildren() () from /lib64/libQt5Core.so.5
#32 0x00007fb1f579b746 in QWidget::~QWidget() () from /lib64/libQt5Widgets.so.5
#33 0x00007fb1f58f2369 in QScrollArea::~QScrollArea() () from /lib64/libQt5Widgets.so.5
#34 0x00007fb1f5fc7a77 in KPageWidgetItem::~KPageWidgetItem() () from /lib64/libKF5WidgetsAddons.so.5
#35 0x00007fb1f5fc9fe9 in PageItem::~PageItem() () from /lib64/libKF5WidgetsAddons.so.5
#36 0x00007fb1f5fcf32b in KPageWidgetModel::removePage(KPageWidgetItem*) () from /lib64/libKF5WidgetsAddons.so.5
#37 0x00007fb1f62cc595 in ModuleView::closeModules() () from /lib64/libsystemsettingsview.so.3
#39 0x00007fb1cc18a32c in SidebarMode::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib64/qt5/plugins/systemsettings_sidebar_mode.so
#40 0x00007fb1cc18acb3 in SidebarMode::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/qt5/plugins/systemsettings_sidebar_mode.so
#41 0x00007fb1f3e5671d in QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const () from /lib64/libQt5Qml.so.5
#42 0x00007fb1f3d61739 in CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call) () from /lib64/libQt5Qml.so.5
#43 0x00007fb1f3d62b6b in QV4::QObjectMethod::callInternal(QV4::Value const*, QV4::Value const*, int) const () from /lib64/libQt5Qml.so.5
#44 0x00007fb1f3d779a9 in QV4::Moth::VME::interpret(QV4::CppStackFrame*, QV4::ExecutionEngine*, char const*) () from /lib64/libQt5Qml.so.5
#46 0x00007fb1f3d1d5ed in QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext const*) () from /lib64/libQt5Qml.so.5
#47 0x00007fb1f3e752f1 in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) () from /lib64/libQt5Qml.so.5
#48 0x00007fb1f3e31ff1 in QQmlBoundSignalExpression::evaluate(void**) () from /lib64/libQt5Qml.so.5
#49 0x00007fb1f3e33a23 in QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) () from /lib64/libQt5Qml.so.5
#50 0x00007fb1f3e5663d in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /lib64/libQt5Qml.so.5
#51 0x00007fb1f4d981d2 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#52 0x00007fb1e1cb2dd1 in QQuickAbstractButtonPrivate::handleRelease(QPointF const&) () from /lib64/libQt5QuickTemplates2.so.5
#53 0x00007fb1e1ccd0f5 in QQuickControl::mouseReleaseEvent(QMouseEvent*) () from /lib64/libQt5QuickTemplates2.so.5
#54 0x00007fb1f4215bf9 in QQuickItem::event(QEvent*) () from /lib64/libQt5Quick.so.5
#55 0x00007fb1f576015f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#56 0x00007fb1f4d69bf8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#57 0x00007fb1f42293c5 in QQuickWindowPrivate::deliverMouseEvent(QQuickPointerMouseEvent*) () from /lib64/libQt5Quick.so.5
#58 0x00007fb1f4229d4f in QQuickWindowPrivate::deliverPointerEvent(QQuickPointerEvent*) () from /lib64/libQt5Quick.so.5
#59 0x00007fb1f5168bd5 in QWindow::event(QEvent*) () from /lib64/libQt5Gui.so.5
#60 0x00007fb1f576015f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#61 0x00007fb1f4d69bf8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#62 0x00007fb1f454f727 in QQuickWidget::mouseReleaseEvent(QMouseEvent*) () from /lib64/libQt5QuickWidgets.so.5
#63 0x00007fb1f579ffbe in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#64 0x00007fb1f576015f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#65 0x00007fb1f576704b in QApplication::notify(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#66 0x00007fb1f4d69bf8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#67 0x00007fb1f5766076 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /lib64/libQt5Widgets.so.5
#68 0x00007fb1f57b8021 in QWidgetWindow::handleMouseEvent(QMouseEvent*) () from /lib64/libQt5Widgets.so.5
#69 0x00007fb1f57bb34e in QWidgetWindow::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#70 0x00007fb1f576015f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#71 0x00007fb1f4d69bf8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#72 0x00007fb1f515d8f0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /lib64/libQt5Gui.so.5
#73 0x00007fb1f513f94b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Gui.so.5
#74 0x00007fb1e2c232aa in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5XcbQpa.so.5
#75 0x00007fb1f2b51fd7 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#76 0x00007fb1f2ba2d88 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#77 0x00007fb1f2b4f41f in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#78 0x00007fb1f4db4a2f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#79 0x00007fb1f4d6865b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#80 0x00007fb1f4d70020 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#81 0x000055ffac978fa8 in main ()
[Inferior 1 (process 8331) detached]

The reporter indicates this bug may be a duplicate of or related to bug 426047.

Possible duplicates by query: bug 426047, bug 423459, bug 422808, bug 422484, bug 418002.

Reported using DrKonqi
Comment 1 David Edmundson 2020-11-01 00:46:12 UTC
Crash is here in kirigami


ContentItem::forgetItem
item->setVisible(false);


we're doing this on an item that's in it's own destructor
Comment 2 David Edmundson 2020-11-01 00:48:45 UTC
*** Bug 423874 has been marked as a duplicate of this bug. ***
Comment 3 David Edmundson 2020-11-01 00:49:00 UTC
*** Bug 420945 has been marked as a duplicate of this bug. ***
Comment 4 David Edmundson 2020-11-01 00:49:25 UTC
*** Bug 420590 has been marked as a duplicate of this bug. ***
Comment 5 Bug Janitor Service 2020-11-01 00:58:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/144
Comment 6 David Edmundson 2020-11-02 14:27:39 UTC
Git commit b0c4bc1c41430f7c778e925715d63ed66fe1ebe0 by David Edmundson.
Committed on 02/11/2020 at 14:26.
Pushed by davidedmundson into branch 'master'.

Don't alter Item in code called from Item's destructor

QQuickItem::~QQuickItem calls setParentItem(null) before closing

This emits itemChange with ItemRemoved on the column view for that item

We then call ContentItem::forgetItem

And adjust the visibility.

This is problematic as we then start emitting all sorts of things after
our item is being destroyed. Objects monitoring, in this case the
attached accessiblity object can then do something that crash.

The only other caller of forgetItem is the removeItem method, so the
setVisible call is moved there.

Tested by setting up orca
Reproducing crash
Testing fix

M  +1    -1    src/columnview.cpp

https://invent.kde.org/frameworks/kirigami/commit/b0c4bc1c41430f7c778e925715d63ed66fe1ebe0
Comment 7 Joe 2020-11-10 06:36:13 UTC
Any chance this will end up back ported to 5.20.x?
Comment 8 Flaviano Matos 2020-11-10 23:25:23 UTC
I solved the problem by removing every occult directory in the user directory.