Bug 357317 - Plasma crash on quit
Summary: Plasma crash on quit
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: unspecified Linux
: NOR crash
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords: drkonqi
: 368029 368079 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-29 22:22 UTC by Kai Uwe Broulik
Modified: 2016-09-13 15:17 UTC (History)
4 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 Kai Uwe Broulik 2015-12-29 22:22:44 UTC
Application: plasmashell (5.5.90)

Qt Version: 5.5.1
Operating System: Linux 4.2.0-19-generic x86_64
Distribution: Ubuntu 15.10

-- Information about the crash:
I ran kquitapp plasmashell on Konsole and then it crashed..

The crash can be reproduced sometimes.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7ff5bb976800 (LWP 18030))]

Thread 9 (Thread 0x7ff5a66a5700 (LWP 18031)):
#0  0x00007ff5b5dec8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ff5ba0b1bd2 in poll (__timeout=-1, __nfds=1, __fds=0x7ff5a66a4cc0) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x18cc5e0, cond=cond@entry=0x18cc620, vector=vector@entry=0x0, count=count@entry=0x0) at ../../src/xcb_conn.c:459
#3  0x00007ff5ba0b374f in xcb_wait_for_event (c=0x18cc5e0) at ../../src/xcb_in.c:623
#4  0x00007ff5a87ee7e9 in QXcbEventReader::run (this=0x18d6c40) at qxcbconnection.cpp:1229
#5  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x18d6c40) at thread/qthread_unix.cpp:331
#6  0x00007ff5b55ce6aa in start_thread (arg=0x7ff5a66a5700) at pthread_create.c:333
#7  0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 8 (Thread 0x7ff59fbd6700 (LWP 18036)):
#0  socketNotifierSourcePrepare (timeout=0x7ff59fbd5be4) at kernel/qeventdispatcher_glib.cpp:64
#1  0x00007ff5b2a7b77d in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ff5b2a7c11b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ff5b2a7c2fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ff5b671a50b in QEventDispatcherGlib::processEvents (this=0x7ff5980008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007ff5b66c150a in QEventLoop::exec (this=this@entry=0x7ff59fbd5da0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007ff5b64ddac4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007ff5b8eddc35 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#8  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x19b9810) at thread/qthread_unix.cpp:331
#9  0x00007ff5b55ce6aa in start_thread (arg=0x7ff59fbd6700) at pthread_create.c:333
#10 0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7ff594807700 (LWP 18062)):
#0  0x00007ff5b5dec8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ff5b2a7c1ec in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ff5b2a7c2fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ff5b671a50b in QEventDispatcherGlib::processEvents (this=0x7ff5900008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#4  0x00007ff5b66c150a in QEventLoop::exec (this=this@entry=0x7ff594806da0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#5  0x00007ff5b64ddac4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#6  0x00007ff5b8eddc35 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x1c6a180) at thread/qthread_unix.cpp:331
#8  0x00007ff5b55ce6aa in start_thread (arg=0x7ff594807700) at pthread_create.c:333
#9  0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7ff58e6d2700 (LWP 18079)):
#0  0x00007ff5b2ac0869 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ff5b2a7b180 in g_main_context_acquire () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ff5b2a7c0a5 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ff5b2a7c2fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ff5b671a50b in QEventDispatcherGlib::processEvents (this=0x7ff5880008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007ff5b66c150a in QEventLoop::exec (this=this@entry=0x7ff58e6d1da0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007ff5b64ddac4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007ff5b8eddc35 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#8  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x1dc1ee0) at thread/qthread_unix.cpp:331
#9  0x00007ff5b55ce6aa in start_thread (arg=0x7ff58e6d2700) at pthread_create.c:333
#10 0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7ff58cd42700 (LWP 18094)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ff5bb3c4194 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#2  0x00007ff5bb3c41d9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#3  0x00007ff5b55ce6aa in start_thread (arg=0x7ff58cd42700) at pthread_create.c:333
#4  0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7ff505c5f700 (LWP 18109)):
#0  0x00007ff5b2a7b620 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ff5b2a7c11b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ff5b2a7c2fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ff5b671a50b in QEventDispatcherGlib::processEvents (this=0x7ff5000008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#4  0x00007ff5b66c150a in QEventLoop::exec (this=this@entry=0x7ff505c5ed50, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#5  0x00007ff5b64ddac4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#6  0x00007ff5b98c32a6 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#7  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x21d36c0) at thread/qthread_unix.cpp:331
#8  0x00007ff5b55ce6aa in start_thread (arg=0x7ff505c5f700) at pthread_create.c:333
#9  0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7ff4f64ac700 (LWP 18122)):
#0  0x00007ff5b2ac0869 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ff5b2a7c1d2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ff5b2a7c2fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ff5b671a50b in QEventDispatcherGlib::processEvents (this=0x7ff4f00008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#4  0x00007ff5b66c150a in QEventLoop::exec (this=this@entry=0x7ff4f64abd80, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#5  0x00007ff5b64ddac4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#6  0x00007ff4f87438f7 in KCupsConnection::run() () from /usr/lib/x86_64-linux-gnu/libkcupslib.so
#7  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x467a360) at thread/qthread_unix.cpp:331
#8  0x00007ff5b55ce6aa in start_thread (arg=0x7ff4f64ac700) at pthread_create.c:333
#9  0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7ff4ea103700 (LWP 19987)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007ff5b64e3c46 in QWaitConditionPrivate::wait_relative (time=30000, this=0x487d610) at thread/qwaitcondition_unix.cpp:126
#2  QWaitConditionPrivate::wait (time=30000, this=0x487d610) at thread/qwaitcondition_unix.cpp:134
#3  QWaitCondition::wait (this=this@entry=0x46f6e80, mutex=mutex@entry=0x50fdfd0, time=30000) at thread/qwaitcondition_unix.cpp:208
#4  0x00007ff5b64df6f3 in QThreadPoolThread::run (this=0x46f6e70) at thread/qthreadpool.cpp:127
#5  0x00007ff5b64e2a6e in QThreadPrivate::start (arg=0x46f6e70) at thread/qthread_unix.cpp:331
#6  0x00007ff5b55ce6aa in start_thread (arg=0x7ff4ea103700) at pthread_create.c:333
#7  0x00007ff5b5df7eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ff5bb976800 (LWP 18030)):
[KCrash Handler]
#6  0x0000000000000030 in ?? ()
#7  0x00007ff5b66cb9d9 in QMetaObject::cast(QObject*) const () at kernel/qmetaobject.cpp:312
#8  0x00007ff5b92c07fb in qobject_cast<QAction*> (object=0x4067200) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:518
#9  0x00007ff5b92c442f in KActionConflictDetector::eventFilter (this=0x18ff3e0, watched=0x4067200, event=0x7fff166a9560) at /home/kaiuwe/Projekte/kf5/src/frameworks/kxmlgui/src/kactionconflictdetector.cpp:44
#10 0x00007ff5b66c3a32 in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=this@entry=0x18bf5b0, receiver=receiver@entry=0x4067200, event=event@entry=0x7fff166a9560) at kernel/qcoreapplication.cpp:1053
#11 0x00007ff5b71d1968 in QApplicationPrivate::notify_helper (this=this@entry=0x18bf5b0, receiver=receiver@entry=0x4067200, e=e@entry=0x7fff166a9560) at kernel/qapplication.cpp:3691
#12 0x00007ff5b71d6ea6 in QApplication::notify (this=0x7fff166aa0d0, receiver=0x4067200, e=0x7fff166a9560) at kernel/qapplication.cpp:3499
#13 0x00007ff5b66c3d7b in QCoreApplication::notifyInternal (this=0x7fff166aa0d0, receiver=0x4067200, event=0x7fff166a9560) at kernel/qcoreapplication.cpp:965
#14 0x00007ff5b99639cc in QQuickWindow::sendEvent(QQuickItem*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#15 0x00007ff5b99659a4 in QQuickWindowPrivate::clearFocusInScope(QQuickItem*, QQuickItem*, Qt::FocusReason, QFlags<QQuickWindowPrivate::FocusOption>) () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#16 0x00007ff5b9955afb in QQuickItem::setParentItem(QQuickItem*) () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#17 0x00007ff5b9956026 in QQuickItem::~QQuickItem() () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#18 0x00007ff5067e4050 in DeclarativeDropArea::~DeclarativeDropArea() () from /usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/draganddrop/libdraganddropplugin.so
#19 0x00007ff5067e6023 in QQmlPrivate::QQmlElement<DeclarativeDropArea>::~QQmlElement() () from /usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/draganddrop/libdraganddropplugin.so
#20 0x00007ff5067e6058 in QQmlPrivate::QQmlElement<DeclarativeDropArea>::~QQmlElement() () from /usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/draganddrop/libdraganddropplugin.so
#21 0x00007ff5bb4eeff3 in PlasmaQuick::AppletQuickItem::~AppletQuickItem() () from /usr/lib/x86_64-linux-gnu/libKF5PlasmaQuick.so.5
#22 0x00007ff58e6e67cd in AppletInterface::~AppletInterface() () from /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/scriptengines/plasma_appletscript_declarative.so
#23 0x00007ff58e705ff9 in ContainmentInterface::~ContainmentInterface() () from /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/scriptengines/plasma_appletscript_declarative.so
#24 0x00007ff58e706032 in ContainmentInterface::~ContainmentInterface() () from /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/scriptengines/plasma_appletscript_declarative.so
#25 0x00007ff5b66f0e5b in QObjectPrivate::deleteChildren (this=this@entry=0x1e52600) at kernel/qobject.cpp:1946
#26 0x00007ff5b66fa6c0 in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1024
#27 0x00007ff5b9e6431c in Plasma::ScriptEngine::~ScriptEngine() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#28 0x00007ff5b9e6347e in Plasma::AppletScript::~AppletScript() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#29 0x00007ff58e6e1c1a in DeclarativeAppletScript::~DeclarativeAppletScript() () from /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/scriptengines/plasma_appletscript_declarative.so
#30 0x00007ff58e6e1c4a in DeclarativeAppletScript::~DeclarativeAppletScript() () from /usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/scriptengines/plasma_appletscript_declarative.so
#31 0x00007ff5b9e0bd61 in Plasma::AppletPrivate::~AppletPrivate() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#32 0x00007ff5b9e0becc in Plasma::AppletPrivate::~AppletPrivate() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#33 0x00007ff5b9df7102 in Plasma::Applet::~Applet() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#34 0x00007ff5b9dfc353 in Plasma::Containment::~Containment() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#35 0x00007ff5b9dfc382 in Plasma::Containment::~Containment() () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#36 0x00000000004a8236 in void qDeleteAll<QList<Plasma::Containment*>::const_iterator>(QList<Plasma::Containment*>::const_iterator, QList<Plasma::Containment*>::const_iterator) ()
#37 0x00000000004a39f9 in void qDeleteAll<QList<Plasma::Containment*> >(QList<Plasma::Containment*> const&) ()
#38 0x0000000000493810 in ShellCorona::~ShellCorona() ()
#39 0x0000000000493978 in ShellCorona::~ShellCorona() ()
#40 0x00007ff5b66f0e5b in QObjectPrivate::deleteChildren (this=this@entry=0x19a2330) at kernel/qobject.cpp:1946
#41 0x00007ff5b66fa6c0 in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1024
#42 0x00000000004b307c in ShellManager::~ShellManager() ()
#43 0x00000000004b30ac in ShellManager::~ShellManager() ()
#44 0x00007ff5b66f37d0 in QObject::event (this=0x1973d20, e=<optimized out>) at kernel/qobject.cpp:1230
#45 0x00007ff5b71d19dc in QApplicationPrivate::notify_helper (this=this@entry=0x18bf5b0, receiver=receiver@entry=0x1973d20, e=e@entry=0x48b0de0) at kernel/qapplication.cpp:3716
#46 0x00007ff5b71d6ea6 in QApplication::notify (this=0x7fff166aa0d0, receiver=0x1973d20, e=0x48b0de0) at kernel/qapplication.cpp:3499
#47 0x00007ff5b66c3d7b in QCoreApplication::notifyInternal (this=0x7fff166aa0d0, receiver=0x1973d20, event=event@entry=0x48b0de0) at kernel/qcoreapplication.cpp:965
#48 0x00007ff5b66c6176 in QCoreApplication::sendEvent (event=0x48b0de0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:224
#49 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=52, data=0x18b55d0) at kernel/qcoreapplication.cpp:1593
#50 0x00007ff5b66c6658 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=52) at kernel/qcoreapplication.cpp:1451
#51 0x00007ff5b66c9629 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1236
#52 0x0000000000470d78 in main ()

Possible duplicates by query: bug 347881.

Reported using DrKonqi
Comment 1 David Edmundson 2016-09-09 15:33:40 UTC
I'm 85% sure I know what it is.

Clue 1:

I have a valgrind warning. but no crash.
==23261== Invalid read of size 8
==23261==    at 0x73A12D5: QQuickItem::~QQuickItem() (qquickitem.cpp:2377)
==23261==    by 0x7418040: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0x7418061: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0xBAA479F: QObjectPrivate::deleteChildren() (qobject.cpp:1970)
==23261==    by 0xBAA2DBC: QObject::~QObject() (qobject.cpp:1041)
==23261==    by 0x73A15E1: QQuickItem::~QQuickItem() (qquickitem.cpp:2342)
==23261==    by 0x279DBA01: DeclarativeDropArea::~DeclarativeDropArea() (DeclarativeDropArea.h:31)
==23261==    by 0x279DDB7E: QQmlPrivate::QQmlElement<DeclarativeDropArea>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0x279DDB9F: QQmlPrivate::QQmlElement<DeclarativeDropArea>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0x505DF71: PlasmaQuick::AppletQuickItem::~AppletQuickItem() (appletquickitem.cpp:425)
==23261==    by 0x225A9648: AppletInterface::~AppletInterface() (appletinterface.cpp:122)
==23261==    by 0x225CAE5C: ContainmentInterface::~ContainmentInterface() (containmentinterface.h:50)
==23261==  Address 0x27722520 is 32 bytes inside a block of size 48 free'd
==23261==    at 0x4C2B1C6: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23261==    by 0x279B2504: QQmlPrivate::QQmlElement<QQuickGridLayout>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0xBAA479F: QObjectPrivate::deleteChildren() (qobject.cpp:1970)
==23261==    by 0xBAA2DBC: QObject::~QObject() (qobject.cpp:1041)
==23261==    by 0x73A15E1: QQuickItem::~QQuickItem() (qquickitem.cpp:2342)
==23261==    by 0x279DBA01: DeclarativeDropArea::~DeclarativeDropArea() (DeclarativeDropArea.h:31)
==23261==    by 0x279DDB7E: QQmlPrivate::QQmlElement<DeclarativeDropArea>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0x279DDB9F: QQmlPrivate::QQmlElement<DeclarativeDropArea>::~QQmlElement() (qqmlprivate.h:104)
==23261==    by 0x505DF71: PlasmaQuick::AppletQuickItem::~AppletQuickItem() (appletquickitem.cpp:425)
==23261==    by 0x225A9648: AppletInterface::~AppletInterface() (appletinterface.cpp:122)
==23261==    by 0x225CAE5C: ContainmentInterface::~ContainmentInterface() (containmentinterface.h:50)
==23261==    by 0x225CAE81: ContainmentInterface::~ContainmentInterface() (containmentinterface.h:50)


so it's trying to delete an object that's already been deleted by itself.

Which implies it's the children() gets muddled about during a QQuickItem's destructor. 

I've seen this before in a differnet place (https://bugreports.qt.io/browse/QTBUG-55460) on a work project with an item that reparented itself whilst the parent was deleting the children.

Clue 2:
I went looking for declarativeDropAreas with children in gammaray.
The only one I've seen is the panel containment 
plasma-desktop/containments/panel/contents/ui/

lastSpacer  will move between being parented between root and nothing depending depending on items. I think it's changing parents whilst root is tearing down, moving to the layout, getting deleted by that..but it's still in the list of items for root to kill .. and then BAM.

If it is that, ideally we should write a test case and fix Qt. But we should probably work around it here. probably by not reparenting willy nilly and just set visible to false.
Comment 2 Kai Uwe Broulik 2016-09-09 16:56:51 UTC
*** Bug 368079 has been marked as a duplicate of this bug. ***
Comment 3 David Edmundson 2016-09-11 23:10:54 UTC
*** Bug 368029 has been marked as a duplicate of this bug. ***
Comment 4 David Edmundson 2016-09-13 15:17:52 UTC
Git commit 389aef07d6adce84aaffedd065004a37b74f6aae by David Edmundson.
Committed on 13/09/2016 at 15:17.
Pushed by davidedmundson into branch 'master'.

Simplify Panel lastSpacer + fix crash

Summary:
The panel contains an invisible Item lastSpacer, who will fill the width
of the layout if no other applet has Layout.fillWidth/Height set,
keeping all applets left aligned.

Previous this worked by reparenting the invisible item in/out of the
layout to the root item. This seems overkill when we can just toggle
visibility. I think the code existed from before the panel was managed
by a Layout.

Worse, the current code leads to a potential crash on teardown.
The root gets deleted, starting a foreach(child, children)
{child->delete}
This kills the task bar, which means we reparent the spacer to the
layout. The layout then finishes killing the children and kills the
spacer. We then get back to the root objects dtor which is now deleting
a previously deleted object. See bug report.

This patch also fixes the fact that addApplet/removeApplet had a
slightly different check to see if the spacer is needed or not, fixing a
hypothetical bug if you had a Hidden applet with fillWidth: true.

Test Plan:
In both horizontal and vertical:
 - have a panel without a task manager
 - add a task manager
 - remove a task manager

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2742

M  +1    -5    containments/panel/contents/code/LayoutManager.js
M  +19   -50   containments/panel/contents/ui/main.qml

http://commits.kde.org/plasma-desktop/389aef07d6adce84aaffedd065004a37b74f6aae