Review Request 120110: Fix a crash when shutting down plasma shell, while destruction models

Joseph Wenninger kde at jowenn.at
Tue Sep 9 11:49:25 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120110/
-----------------------------------------------------------

(Updated Sept. 9, 2014, 11:49 vorm.)


Status
------

This change has been marked as submitted.


Review request for KDE Frameworks and Plasma.


Repository: plasma-framework


Description
-------

Fix a crash when shutting down plasma shell, while destruction models


While porting the kate session applet to plasma KF5, I noticed plasmashell crashing while using "kquitapp5 plasmashell" while destroying the model in the clipboard engine and in my engine (which is based on the clipboard engine). 

The problem for me was, that the lambda  in Plasma::DataEngine:167 accessed m_models, which was/is not valid anymore.

Thread 1 (Thread 0x7f2f4cadb880 (LWP 4241)):
[KCrash Handler]
#6  0x00007f2f488336df in QQmlOpenMetaObject::setValue(QByteArray const&, QVariant const&) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Qml.so.5
#7  0x00007f2f486c6d14 in QQmlPropertyMap::clear(QString const&) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Qml.so.5
#8  0x00007f2f2dfb94e4 in Plasma::DataSource::<lambda()>::operator()(void) const (__closure=0x7fffb8e86670) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/declarativeimports/core/datasource.cpp:167
#9  0x00007f2f2dfb9b88 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Plasma::DataSource::modelChanged(const QString&, QAbstractItemModel*)::<lambda()> >::call(Plasma::DataSource::<lambda()>, void **) (f=..., arg=0x7fffb8e86800) at /home/jowenn/KDE/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:502
#10 0x00007f2f2dfb9b5e in QtPrivate::Functor<Plasma::DataSource::modelChanged(const QString&, QAbstractItemModel*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(Plasma::DataSource::<lambda()> &, void *, void **) (f=..., arg=0x7fffb8e86800) at /home/jowenn/KDE/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:559
#11 0x00007f2f2dfb9b13 in QtPrivate::QFunctorSlotObject<Plasma::DataSource::modelChanged(const QString&, QAbstractItemModel*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x56aee80, r=0x5776340, a=0x7fffb8e86800, ret=0x0) at /home/jowenn/KDE/qt5/qtbase/src/corelib/kernel/qobject_impl.h:200
#12 0x00007f2f459656be in QMetaObject::activate(QObject*, int, int, void**) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#13 0x00007f2f4596609f in QObject::destroyed(QObject*) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#14 0x00007f2f4596d70b in QObject::~QObject() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#15 0x00007f2f458ddd1d in QAbstractItemModel::~QAbstractItemModel() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#16 0x00007f2e401af49e in KateSessionsModel::~KateSessionsModel (this=0x5776340, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsmodel.cpp:59
#17 0x00007f2e401af4ce in KateSessionsModel::~KateSessionsModel (this=0x5776340, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsmodel.cpp:61
#18 0x00007f2f4596460c in QObjectPrivate::deleteChildren() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#19 0x00007f2f4596d493 in QObject::~QObject() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#20 0x00007f2f4b644e47 in Plasma::DataContainer::~DataContainer (this=0x5775ef0, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/datacontainer.cpp:37
#21 0x00007f2f4b644e76 in Plasma::DataContainer::~DataContainer (this=0x5775ef0, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/datacontainer.cpp:40
#22 0x00007f2f4596460c in QObjectPrivate::deleteChildren() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#23 0x00007f2f4596d493 in QObject::~QObject() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5
#24 0x00007f2f4b648c21 in Plasma::DataEngine::~DataEngine (this=0x5774b50, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/dataengine.cpp:76
#25 0x00007f2e401ae418 in KateSessionsEngine::~KateSessionsEngine (this=0x5774b50, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsengine.cpp:36
#26 0x00007f2e401ae448 in KateSessionsEngine::~KateSessionsEngine (this=0x5774b50, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsengine.cpp:38
#27 0x00007f2f4b65133d in Plasma::DataEngineManager::unloadEngine (this=0x7f2f4b8dc7c0 <Plasma::(anonymous namespace)::Q_QGS_privateDataEngineManagerSelf::innerFunction()::holder>, name=...) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/private/dataenginemanager.cpp:159
#28 0x00007f2f4b64cc6d in Plasma::DataEngineConsumer::~DataEngineConsumer (this=0x552c070, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/dataengineconsumer.cpp:85
#29 0x00007f2f2dfa523a in Plasma::DataSource::~DataSource (this=0x552c060, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/declarativeimports/core/datasource.h:43
#30 0x00007f2f2dfac8b8 in QQmlPrivate::QQmlElement<Plasma::DataSource>::~QQmlElement (this=0x552c060, __in_chrg=<optimized out>) at /home/jowenn/KDE/qt5/qtdeclarative/src/qml/qml/qqmlprivate.h:106
#31 0x00007f2f2dfac8e8 in QQmlPrivate::QQmlElement<Plasma::DataSource>::~QQmlElement (this=0x552c060, __in_chrg=<optimized out>) at /home/jowenn/KDE/qt5/qtdeclarative/src/qml/qml/qqmlprivate.h:106


Diffs
-----

  src/declarativeimports/core/datasource.cpp 2e7a2af4919f85bb385e95f2a29f9cdb5e7ecfda 
  src/declarativeimports/core/datasource.h 3a8b522919f04f8581e98271aff55ccc001062c8 

Diff: https://git.reviewboard.kde.org/r/120110/diff/


Testing
-------

This part of plasma shell does not cause a crash for me anymore.


Thanks,

Joseph Wenninger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140909/32d6d849/attachment.html>


More information about the Plasma-devel mailing list