Skip to content

klipper: don't reset model in dtor

Fushan Wen requested to merge work/fuf/nocrash into master

Reason for the change

The reset signal might be propagated to somewhere that is dangling.

AddressSanitizer:DEADLYSIGNAL
=================================================================
==31341==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7ff4314d12ca bp 0x5120001af5c0 sp 0x7ffd6e43b4f0 T0)
==31341==The signal is caused by a READ memory access.
==31341==Hint: address points to the zero page.
    #0 0x7ff4314d12ca  (/lib64/libQt6Gui.so.6+0x1612ca) (BuildId: ea268b9df89ef254e3de60f13856be1e36aeb75d)
    #1 0x7ff431877fb0 in QAccessibleEvent::accessibleInterface() const (/lib64/libQt6Gui.so.6+0x507fb0) (BuildId: ea268b9df89ef254e3de60f13856be1e36aeb75d)
    #2 0x7ff431876fa0 in QAccessible::updateAccessibility(QAccessibleEvent*) (/lib64/libQt6Gui.so.6+0x506fa0) (BuildId: ea268b9df89ef254e3de60f13856be1e36aeb75d)
    #3 0x7ff4361119e1 in QQuickItem::focusInEvent(QFocusEvent*) (/lib64/libQt6Quick.so.6+0x21e9e1) (BuildId: 7153a3393e04be5b499251cc5108b2c6f3442473)
    #4 0x7ff40dc8d678 in QQuickControl::focusInEvent(QFocusEvent*) (/lib64/libQt6QuickTemplates2.so.6+0xfd678) (BuildId: 5f8756db74306927b87c42561406e2c765db0962)
    #5 0x7ff43611cfe8 in QQuickItem::event(QEvent*) (/lib64/libQt6Quick.so.6+0x229fe8) (BuildId: 7153a3393e04be5b499251cc5108b2c6f3442473)
    #6 0x7ff432431f2d in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/lib64/libQt6Widgets.so.6+0x1c2f2d) (BuildId: 05caac3927f2f8c331810dd7ba294320b2ed8e90)
    #7 0x7ff430ed901f in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/lib64/libQt6Core.so.6+0x18f01f) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #8 0x7ff4362970a4 in QQuickDeliveryAgentPrivate::clearFocusInScope(QQuickItem*, QQuickItem*, Qt::FocusReason, QFlags<QQuickDeliveryAgentPrivate::FocusOption>) (/lib64/libQt6Quick.so.6+0x3a40a4) (BuildId: 7153a3393e04be5b499251cc5108b2c6f3442473)
    #9 0x7ff436114b40 in QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem*, bool) (/lib64/libQt6Quick.so.6+0x221b40) (BuildId: 7153a3393e04be5b499251cc5108b2c6f3442473)
    #10 0x7ff4361149ff in QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem*, bool) (/lib64/libQt6Quick.so.6+0x2219ff) (BuildId: 7153a3393e04be5b499251cc5108b2c6f3442473)
    #11 0x7ff435c0ff93  (/lib64/libQt6Qml.so.6+0x283f93) (BuildId: 67492630690292197d366a46a327bc75abfe9fae)
    #12 0x7ff435c23ec5  (/lib64/libQt6Qml.so.6+0x297ec5) (BuildId: 67492630690292197d366a46a327bc75abfe9fae)
    #13 0x7ff435c226cc in QQmlBinding::doUpdate(QQmlJavaScriptExpression::DeleteWatcher const&, QFlags<QQmlPropertyData::WriteFlag>, QV4::Scope&) (/lib64/libQt6Qml.so.6+0x2966cc) (BuildId: 67492630690292197d366a46a327bc75abfe9fae)
    #14 0x7ff435c20613 in QQmlBinding::update(QFlags<QQmlPropertyData::WriteFlag>) (/lib64/libQt6Qml.so.6+0x294613) (BuildId: 67492630690292197d366a46a327bc75abfe9fae)
    #15 0x7ff435c95bd7 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) (/lib64/libQt6Qml.so.6+0x309bd7) (BuildId: 67492630690292197d366a46a327bc75abfe9fae)
    #16 0x7ff430f31e67  (/lib64/libQt6Core.so.6+0x1e7e67) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #17 0x7ff40b18327a in KSortFilterProxyModel::rowCountChanged() /builds/frameworks/kitemmodels/_build/src/qml/itemmodelsplugin_autogen/include/moc_ksortfilterproxymodel.cpp:409
    #18 0x7ff40b190c28 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KSortFilterProxyModel::*)()>::call(void (KSortFilterProxyModel::*)(), KSortFilterProxyModel*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145
    #19 0x7ff40b18fdb5 in void QtPrivate::FunctionPointer<void (KSortFilterProxyModel::*)()>::call<QtPrivate::List<>, void>(void (KSortFilterProxyModel::*)(), KSortFilterProxyModel*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182
    #20 0x7ff40b18e4a9 in QtPrivate::QCallableObject<void (KSortFilterProxyModel::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:553
    #21 0x7ff430f32422  (/lib64/libQt6Core.so.6+0x1e8422) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #22 0x7ff4310be1fc in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) (/lib64/libQt6Core.so.6+0x3741fc) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #23 0x7ff4310e9071  (/lib64/libQt6Core.so.6+0x39f071) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #24 0x7ff430f32422  (/lib64/libQt6Core.so.6+0x1e8422) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #25 0x7ff4310be1fc in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) (/lib64/libQt6Core.so.6+0x3741fc) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #26 0x7ff40748b2c7 in HistoryModel::clear() /builds/plasma/plasma-workspace/klipper/historymodel.cpp:29
    #27 0x7ff40748b0da in HistoryModel::~HistoryModel() /builds/plasma/plasma-workspace/klipper/historymodel.cpp:21
    #28 0x7ff40748b17b in HistoryModel::~HistoryModel() /builds/plasma/plasma-workspace/klipper/historymodel.cpp:22
    #29 0x7ff430f1aa82 in QObjectPrivate::deleteChildren() (/lib64/libQt6Core.so.6+0x1d0a82) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #30 0x7ff430f21a07 in QObject::~QObject() (/lib64/libQt6Core.so.6+0x1d7a07) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #31 0x7ff40a68791a in Plasma5Support::DataContainer::~DataContainer() /builds/plasma/plasma5support/src/plasma5support/datacontainer.cpp:28
    #32 0x7ff40a687959 in Plasma5Support::DataContainer::~DataContainer() /builds/plasma/plasma5support/src/plasma5support/datacontainer.cpp:28
    #33 0x7ff430f1aa82 in QObjectPrivate::deleteChildren() (/lib64/libQt6Core.so.6+0x1d0a82) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #34 0x7ff430f21a07 in QObject::~QObject() (/lib64/libQt6Core.so.6+0x1d7a07) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #35 0x7ff40a6b51e2 in Plasma5Support::DataEngine::~DataEngine() /builds/plasma/plasma5support/src/plasma5support/dataengine.cpp:51
    #36 0x7ff4073abee1 in ClipboardEngine::~ClipboardEngine() /builds/plasma/plasma-workspace/klipper/clipboardengine.cpp:39
    #37 0x7ff4073abf21 in ClipboardEngine::~ClipboardEngine() /builds/plasma/plasma-workspace/klipper/clipboardengine.cpp:39
    #38 0x7ff40a6fc806 in Plasma5Support::DataEngineManagerPrivate::~DataEngineManagerPrivate() /builds/plasma/plasma5support/src/plasma5support/private/dataenginemanager.cpp:48
    #39 0x7ff40a6f75e8 in Plasma5Support::DataEngineManager::~DataEngineManager() /builds/plasma/plasma5support/src/plasma5support/private/dataenginemanager.cpp:88
    #40 0x7ff40a7043e5 in Plasma5Support::DataEngineManagerSingleton::~DataEngineManagerSingleton() /builds/plasma/plasma5support/src/plasma5support/private/dataenginemanager.cpp:67
    #41 0x7ff40a6fb8b1 in ~Holder /usr/include/qt6/QtCore/qglobalstatic.h:45
    #42 0x7ff4309309e5 in __run_exit_handlers (/lib64/libc.so.6+0x439e5) (BuildId: 96b8eb5a4407af753cc31c18e7c116279f2eab1f)
    #43 0x7ff430930b2f in exit (/lib64/libc.so.6+0x43b2f) (BuildId: 96b8eb5a4407af753cc31c18e7c116279f2eab1f)
    #44 0x7ff4310516e8 in QCommandLineParser::process(QList<QString> const&) (/lib64/libQt6Core.so.6+0x3076e8) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #45 0x24eb3f in PlasmaWindowedCorona::activateRequested(QList<QString> const&, QString const&) /builds/plasma/plasma-workspace/plasma-windowed/plasmawindowedcorona.cpp:112
    #46 0x2823e6 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<QList<QString> const&, QString const&>, void, void (PlasmaWindowedCorona::*)(QList<QString> const&, QString const&)>::call(void (PlasmaWindowedCorona::*)(QList<QString> const&, QString const&), PlasmaWindowedCorona*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145
    #47 0x2818bb in void QtPrivate::FunctionPointer<void (PlasmaWindowedCorona::*)(QList<QString> const&, QString const&)>::call<QtPrivate::List<QList<QString> const&, QString const&>, void>(void (PlasmaWindowedCorona::*)(QList<QString> const&, QString const&), PlasmaWindowedCorona*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182
    #48 0x28114b in QtPrivate::QCallableObject<void (PlasmaWindowedCorona::*)(QList<QString> const&, QString const&), QtPrivate::List<QList<QString> const&, QString const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:553
    #49 0x7ff430f32422  (/lib64/libQt6Core.so.6+0x1e8422) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #50 0x7ff43ab9f9d7 in KDBusService::activateRequested(QList<QString> const&, QString const&) /builds/frameworks/kdbusaddons/_build/src/KF6DBusAddons_autogen/include/moc_kdbusservice.cpp:222
    #51 0x7ff43ab9e725 in KDBusService::CommandLine(QList<QString> const&, QString const&, QMap<QString, QVariant> const&) /builds/frameworks/kdbusaddons/src/kdbusservice.cpp:349
    #52 0x7ff43ac154b6 in KDBusServiceExtensionsAdaptor::CommandLine(QList<QString> const&, QString const&, QMap<QString, QVariant> const&) /builds/frameworks/kdbusaddons/_build/src/kdbusserviceextensions_adaptor.cpp:39
    #53 0x7ff43ac15653 in KDBusServiceExtensionsAdaptor::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /builds/frameworks/kdbusaddons/_build/src/moc_kdbusserviceextensions_adaptor.cpp:110
    #54 0x7ff43ac15a81 in KDBusServiceExtensionsAdaptor::qt_metacall(QMetaObject::Call, int, void**) /builds/frameworks/kdbusaddons/_build/src/moc_kdbusserviceextensions_adaptor.cpp:137
    #55 0x7ff43b786aee  (/lib64/libQt6DBus.so.6+0x43aee) (BuildId: ec4147ec4b43793ca69501f302876039410f8220)
    #56 0x7ff43b7877ad  (/lib64/libQt6DBus.so.6+0x447ad) (BuildId: ec4147ec4b43793ca69501f302876039410f8220)
    #57 0x7ff43b78f6b5  (/lib64/libQt6DBus.so.6+0x4c6b5) (BuildId: ec4147ec4b43793ca69501f302876039410f8220)
    #58 0x7ff43b78f6ed  (/lib64/libQt6DBus.so.6+0x4c6ed) (BuildId: ec4147ec4b43793ca69501f302876039410f8220)
    #59 0x7ff430f1c2cd in QObject::event(QEvent*) (/lib64/libQt6Core.so.6+0x1d22cd) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #60 0x7ff432431f2d in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/lib64/libQt6Widgets.so.6+0x1c2f2d) (BuildId: 05caac3927f2f8c331810dd7ba294320b2ed8e90)
    #61 0x7ff430ed901f in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/lib64/libQt6Core.so.6+0x18f01f) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #62 0x7ff430ed937f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/lib64/libQt6Core.so.6+0x18f37f) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #63 0x7ff43110bf52  (/lib64/libQt6Core.so.6+0x3c1f52) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #64 0x7ff42fb1273f  (/lib64/libglib-2.0.so.0+0x5d73f) (BuildId: 2cf7471b35e06666a442d9fff3cb06cb606f6753)
    #65 0x7ff42fb14387  (/lib64/libglib-2.0.so.0+0x5f387) (BuildId: 2cf7471b35e06666a442d9fff3cb06cb606f6753)
    #66 0x7ff42fb14a3b in g_main_context_iteration (/lib64/libglib-2.0.so.0+0x5fa3b) (BuildId: 2cf7471b35e06666a442d9fff3cb06cb606f6753)
    #67 0x7ff43110aa0b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/lib64/libQt6Core.so.6+0x3c0a0b) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #68 0x7ff430ee379a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/lib64/libQt6Core.so.6+0x19979a) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #69 0x7ff430edcfa5 in QCoreApplication::exec() (/lib64/libQt6Core.so.6+0x192fa5) (BuildId: b381724dca6ded0e900824321c27b29af70a08b1)
    #70 0x27e791 in main /builds/plasma/plasma-workspace/plasma-windowed/main.cpp:78
    #71 0x7ff4309171ef in __libc_start_call_main (/lib64/libc.so.6+0x2a1ef) (BuildId: 96b8eb5a4407af753cc31c18e7c116279f2eab1f)
    #72 0x7ff4309172b8 in __libc_start_main_alias_2 (/lib64/libc.so.6+0x2a2b8) (BuildId: 96b8eb5a4407af753cc31c18e7c116279f2eab1f)
    #73 0x243e04 in _start ../sysdeps/x86_64/start.S:115
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libQt6Gui.so.6+0x1612ca) (BuildId: ea268b9df89ef254e3de60f13856be1e36aeb75d)
==31341==ABORTING

Test plan

Pass clipboardtest

Screenshots or screen recordings

Bugs fixed

Merge request reports

Loading