Bug 356545

Summary: Plasma 5.5.0 crash after removing panel
Product: [Plasma] plasmashell Reporter: opensuse.lietuviu.kalba
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: crash CC: bhush94, davidsboogs, f.st, plasma-bugs
Priority: NOR Keywords: drkonqi
Version: 5.5.0   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: new example

Description opensuse.lietuviu.kalba 2015-12-12 10:41:17 UTC
Application: plasmashell (5.5.0)

Qt Version: 5.5.0
Operating System: Linux 4.1.13-5-default x86_64
Distribution (Platform): openSUSE RPMs

-- Information about the crash:
- What I was doing when the application crashed:

Added empty panel, added prorgams in it, changed visibility options, locked, unlocked, changed order of icons, changed height, widht, locked panel, unlocked panel, removed panel. Imediate crash.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f996d0167c0 (LWP 6349))]

Thread 8 (Thread 0x7f9956aab700 (LWP 6352)):
#0  0x00007f9966542c1d in poll () from /lib64/libc.so.6
#1  0x00007f996b469422 in poll (__timeout=-1, __nfds=1, __fds=0x7f9956aaad00) at /usr/include/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x1625e80, cond=cond@entry=0x1625ec0, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:459
#3  0x00007f996b46b00f in xcb_wait_for_event (c=0x1625e80) at xcb_in.c:693
#4  0x00007f9958bfbc29 in QXcbEventReader::run (this=0x16343d0) at qxcbconnection.cpp:1214
#5  0x00007f9966c3955f in QThreadPrivate::start (arg=0x16343d0) at thread/qthread_unix.cpp:331
#6  0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#7  0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7f994ffff700 (LWP 6365)):
#0  g_mutex_unlock (mutex=0x7f9948000990) at gthread-posix.c:1348
#1  0x00007f9962c234a0 in g_main_context_prepare (context=context@entry=0x7f9948000990, priority=priority@entry=0x7f994fffecb8) at gmain.c:3408
#2  0x00007f9962c23d80 in g_main_context_iterate (context=context@entry=0x7f9948000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3788
#3  0x00007f9962c23f7c in g_main_context_iteration (context=0x7f9948000990, may_block=1) at gmain.c:3869
#4  0x00007f9966e6aa5b in QEventDispatcherGlib::processEvents (this=0x7f99480008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f9966e11a63 in QEventLoop::exec (this=this@entry=0x7f994fffedf0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f9966c3484a in QThread::exec (this=this@entry=0x16f7d30) at thread/qthread.cpp:503
#7  0x00007f9969f1d5f8 in QQmlThreadPrivate::run (this=0x16f7d30) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/qml/ftw/qqmlthread.cpp:141
#8  0x00007f9966c3955f in QThreadPrivate::start (arg=0x16f7d30) at thread/qthread_unix.cpp:331
#9  0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7f993cd2e700 (LWP 6437)):
#0  0x00007f9962c65cf9 in g_mutex_lock (mutex=mutex@entry=0x7f9938000990) at gthread-posix.c:1336
#1  0x00007f9962c238fc in g_main_context_check (context=context@entry=0x7f9938000990, max_priority=2147483647, fds=fds@entry=0x7f9938002e70, n_fds=n_fds@entry=1) at gmain.c:3651
#2  0x00007f9962c23df8 in g_main_context_iterate (context=context@entry=0x7f9938000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3805
#3  0x00007f9962c23f7c in g_main_context_iteration (context=0x7f9938000990, may_block=1) at gmain.c:3869
#4  0x00007f9966e6aa5b in QEventDispatcherGlib::processEvents (this=0x7f99380008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f9966e11a63 in QEventLoop::exec (this=this@entry=0x7f993cd2ddf0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f9966c3484a in QThread::exec (this=this@entry=0x18c65a0) at thread/qthread.cpp:503
#7  0x00007f9969f1d5f8 in QQmlThreadPrivate::run (this=0x18c65a0) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/qml/ftw/qqmlthread.cpp:141
#8  0x00007f9966c3955f in QThreadPrivate::start (arg=0x18c65a0) at thread/qthread_unix.cpp:331
#9  0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f99377ff700 (LWP 6439)):
#0  0x00007f9965d5005f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f996c6ed7eb in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x7f996c9d4ea0 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x00007f996c6ed819 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f98b6009700 (LWP 6441)):
#0  0x00007f9962c65cf9 in g_mutex_lock (mutex=mutex@entry=0x7f98b0000990) at gthread-posix.c:1336
#1  0x00007f9962c238fc in g_main_context_check (context=context@entry=0x7f98b0000990, max_priority=2147483647, fds=fds@entry=0x7f98b0003070, n_fds=n_fds@entry=1) at gmain.c:3651
#2  0x00007f9962c23df8 in g_main_context_iterate (context=context@entry=0x7f98b0000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3805
#3  0x00007f9962c23f7c in g_main_context_iteration (context=0x7f98b0000990, may_block=1) at gmain.c:3869
#4  0x00007f9966e6aa5b in QEventDispatcherGlib::processEvents (this=0x7f98b00008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f9966e11a63 in QEventLoop::exec (this=this@entry=0x7f98b6008df0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f9966c3484a in QThread::exec (this=this@entry=0x1af2270) at thread/qthread.cpp:503
#7  0x00007f9969f1d5f8 in QQmlThreadPrivate::run (this=0x1af2270) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/qml/ftw/qqmlthread.cpp:141
#8  0x00007f9966c3955f in QThreadPrivate::start (arg=0x1af2270) at thread/qthread_unix.cpp:331
#9  0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f98addb5700 (LWP 6490)):
#0  0x00007ffd7dbfab30 in clock_gettime ()
#1  0x00007f9966557c9d in clock_gettime () from /lib64/libc.so.6
#2  0x00007f9966ce9b06 in qt_clock_gettime (ts=0x7f98addb4b40, clock=<optimized out>) at tools/qelapsedtimer_unix.cpp:105
#3  do_gettime (frac=<synthetic pointer>, sec=<synthetic pointer>) at tools/qelapsedtimer_unix.cpp:156
#4  qt_gettime () at tools/qelapsedtimer_unix.cpp:165
#5  0x00007f9966e69089 in QTimerInfoList::updateCurrentTime (this=this@entry=0x7f98a8002ed0) at kernel/qtimerinfo_unix.cpp:84
#6  0x00007f9966e69615 in QTimerInfoList::timerWait (this=0x7f98a8002ed0, tm=...) at kernel/qtimerinfo_unix.cpp:381
#7  0x00007f9966e6a82e in timerSourcePrepareHelper (timeout=0x7f98addb4bf4, src=<optimized out>) at kernel/qeventdispatcher_glib.cpp:127
#8  timerSourcePrepare (source=<optimized out>, timeout=timeout@entry=0x7f98addb4bf4) at kernel/qeventdispatcher_glib.cpp:160
#9  0x00007f9962c234ad in g_main_context_prepare (context=context@entry=0x7f98a8000990, priority=priority@entry=0x7f98addb4c78) at gmain.c:3410
#10 0x00007f9962c23d80 in g_main_context_iterate (context=context@entry=0x7f98a8000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3788
#11 0x00007f9962c23f7c in g_main_context_iteration (context=0x7f98a8000990, may_block=1) at gmain.c:3869
#12 0x00007f9966e6aa5b in QEventDispatcherGlib::processEvents (this=0x7f98a80008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#13 0x00007f9966e11a63 in QEventLoop::exec (this=this@entry=0x7f98addb4db0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#14 0x00007f9966c3484a in QThread::exec (this=this@entry=0x1f31de0) at thread/qthread.cpp:503
#15 0x00007f996aab0f82 in QQuickPixmapReader::run (this=0x1f31de0) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/quick/util/qquickpixmapcache.cpp:754
#16 0x00007f9966c3955f in QThreadPrivate::start (arg=0x1f31de0) at thread/qthread_unix.cpp:331
#17 0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#18 0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f989df0e700 (LWP 6526)):
#0  0x00007f9966542c1d in poll () from /lib64/libc.so.6
#1  0x00007f9962c23e64 in g_main_context_poll (priority=2147483647, n_fds=1, fds=0x7f98980048d0, timeout=1897660, context=0x7f9898000990) at gmain.c:4103
#2  g_main_context_iterate (context=context@entry=0x7f9898000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3803
#3  0x00007f9962c23f7c in g_main_context_iteration (context=0x7f9898000990, may_block=1) at gmain.c:3869
#4  0x00007f9966e6aa5b in QEventDispatcherGlib::processEvents (this=0x7f98980008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f9966e11a63 in QEventLoop::exec (this=this@entry=0x7f989df0ddd0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f9966c3484a in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f989f55bcf7 in KCupsConnection::run() () from /usr/lib64/libkcupslib.so
#8  0x00007f9966c3955f in QThreadPrivate::start (arg=0x22f28c0) at thread/qthread_unix.cpp:331
#9  0x00007f9965d4c0a4 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f996654b04d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f996d0167c0 (LWP 6349)):
[KCrash Handler]
#6  0x0000000000000020 in ?? ()
#7  0x00007f9969e8e9a5 in cache (obj=0x23741d0, this=0x1b70090) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsapi/qjsengine_p.h:167
#8  QQmlData::ensurePropertyCache (engine=<optimized out>, object=object@entry=0x23741d0) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/qml/qqmlengine.cpp:1832
#9  0x00007f9969e5c241 in QV4::QObjectWrapper::create (engine=engine@entry=0x1b68b60, object=object@entry=0x23741d0) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:688
#10 0x00007f9969e5d815 in QV4::QObjectWrapper::wrap (engine=engine@entry=0x1b68b60, object=0x23741d0) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:594
#11 0x00007f9969ddea2c in QV4::ExecutionEngine::fromVariant (this=this@entry=0x1b68b60, variant=...) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4engine.cpp:1418
#12 0x00007f9969f0e061 in QV4::QmlContextWrapper::get (m=<optimized out>, name=<optimized out>, hasProperty=<optimized out>) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/qml/qqmlcontextwrapper.cpp:232
#13 0x00007f9969de6e29 in get (hasProperty=0x7ffd7db0fa10, name=0x7f98b500a0e0, this=<optimized out>) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4object_p.h:276
#14 QV4::ExecutionContext::getProperty (this=0x7f98b500a0e8, name=0x7f98b500a0e0) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4context.cpp:383
#15 0x00007f9969e74b87 in QV4::Runtime::getActivationProperty (engine=0x1b68b60, nameIndex=<optimized out>) at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4runtime.cpp:690
#16 0x00007f98ac7817cd in ?? ()
#17 0x0000000000000000 in ?? ()

Possible duplicates by query: bug 355725, bug 355431.

Reported using DrKonqi
Comment 1 David Edmundson 2015-12-13 17:20:33 UTC
*** Bug 356546 has been marked as a duplicate of this bug. ***
Comment 2 opensuse.lietuviu.kalba 2015-12-15 08:14:44 UTC
As you see in https://bugsfiles.kde.org/attachment.cgi?id=96004 and https://www.youtube.com/watch?v=XNAf3UU8yI8 , crash occurs, if user press x button on notification just after removing of panel.
Comment 3 opensuse.lietuviu.kalba 2015-12-15 08:40:49 UTC
Created attachment 96079 [details]
new example
Comment 4 David Edmundson 2015-12-20 20:40:42 UTC
So you can make it crash every time?
Comment 5 David Edmundson 2015-12-20 20:40:54 UTC
*** Bug 356719 has been marked as a duplicate of this bug. ***
Comment 6 opensuse.lietuviu.kalba 2015-12-20 20:43:26 UTC
Yes, if I good remember, I can reproduce every time.
Comment 7 opensuse.lietuviu.kalba 2015-12-20 20:45:01 UTC
To be presize:
if I close notification about removed panel – it crash ALWAYS.
If I don't close notification – it crash only sometimes.
Comment 8 opensuse.lietuviu.kalba 2015-12-20 20:46:11 UTC
And though closing or not closing notification may lead to crash, I don't know, if these bugs are realy identical.
Comment 9 David Edmundson 2015-12-23 16:31:47 UTC
Valgrind trace

Seems we have some QML still alive and trying to access the view after it's been deleted.

==30841==    at 0x81339CC: QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::data() const (qscopedpointer.h:135)
==30841==    by 0x8140BE8: QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::pointer qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > >(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > const&) (qglobal.h:983)
==30841==    by 0x8141165: QObject::d_func() (qobject.h:110)
==30841==    by 0x814133F: QObjectPrivate::get(QObject*) (qobject_p.h:192)
==30841==    by 0x834EC8F: QQmlData::wasDeleted(QObject*) (qqmldata_p.h:240)
==30841==    by 0x83474C2: QV4::QObjectWrapper::wrap(QV4::ExecutionEngine*, QObject*) (qv4qobjectwrapper.cpp:572)
==30841==    by 0x829E07B: QV4::ExecutionEngine::fromVariant(QVariant const&) (qv4engine.cpp:1423)
==30841==    by 0x842A50A: QV4::QmlContextWrapper::get(QV4::Managed*, QV4::String*, bool*) (qqmlcontextwrapper.cpp:232)
==30841==    by 0x821DCD8: QV4::Object::get(QV4::String*, bool*) (qv4object_p.h:276)
==30841==    by 0x82AEB5E: QV4::ExecutionContext::getProperty(QV4::String*) (qv4context.cpp:383)
==30841==    by 0x8366D91: QV4::Runtime::getActivationProperty(QV4::ExecutionEngine*, int) (qv4runtime.cpp:693)
==30841==    by 0x359D37CC: ???
==30841==  Address 0x3173d0a8 is 8 bytes inside a block of size 248 free'd
==30841==    at 0x4C2A144: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30841==    by 0x481AB1: PanelView::~PanelView() (panelview.cpp:124)
==30841==    by 0xBC6150A: qDeleteInEventHandler(QObject*) (qobject.cpp:4455)
==30841==    by 0xBC58F37: QObject::event(QEvent*) (qobject.cpp:1230)
==30841==    by 0xB35C32B: QWindow::event(QEvent*) (qwindow.cpp:2077)
==30841==    by 0x7591EF8: QQuickWindow::event(QEvent*) (qquickwindow.cpp:1413)
==30841==    by 0x485C3A: PanelView::event(QEvent*) (panelview.cpp:844)
==30841==    by 0xA95D5F5: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:3716)
==30841==    by 0xA95AD54: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:3160)
==30841==    by 0xBC21055: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:965)
==30841==    by 0xBC24D74: QCoreApplication::sendEvent(QObject*, QEvent*) (in /opt/qt5/lib/libQt5Core.so.5.5.1)
==30841==    by 0xBC223D1: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (qcoreapplication.cpp:1593)
==30841==  Block was alloc'd at
==30841==    at 0x4C29118: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30841==    by 0x49AB0A: ShellCorona::createWaitingPanels() (shellcorona.cpp:1016)
==30841==    by 0x49F32C: ShellCorona::addPanel(QString const&) (shellcorona.cpp:1526)
==30841==    by 0x49F03F: ShellCorona::addPanel(QAction*) (shellcorona.cpp:1488)
==30841==    by 0x4A06FE: ShellCorona::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_shellcorona.cpp:295)
==30841==    by 0xBC5F9CC: QMetaObject::activate(QObject*, int, int, void**) (qobject.cpp:3713)
==30841==    by 0xBC5F1D7: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3578)
==30841==    by 0xAB593D6: QMenu::triggered(QAction*) (moc_qmenu.cpp:273)
==30841==    by 0xAB50EA4: QMenuPrivate::_q_actionTriggered() (qmenu.cpp:1232)
==30841==    by 0xAB58DDF: QMenu::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qmenu.cpp:122)
==30841==    by 0xBC5F9CC: QMetaObject::activate(QObject*, int, int, void**) (qobject.cpp:3713)
==30841==    by 0xBC5F1D7: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3578)
==30841== 
==30841== Invalid read of size 1
==30841==    at 0x834EC9F: QQmlData::wasDeleted(QObject*) (qqmldata_p.h:241)
==30841==    by 0x83474C2: QV4::QObjectWrapper::wrap(QV4::ExecutionEngine*, QObject*) (qv4qobjectwrapper.cpp:572)
==30841==    by 0x829E07B: QV4::ExecutionEngine::fromVariant(QVariant const&) (qv4engine.cpp:1423)
==30841==    by 0x842A50A: QV4::QmlContextWrapper::get(QV4::Managed*, QV4::String*, bool*) (qqmlcontextwrapper.cpp:232)
==30841==    by 0x821DCD8: QV4::Object::get(QV4::String*, bool*) (qv4object_p.h:276)
==30841==    by 0x82AEB5E: QV4::ExecutionContext::getProperty(QV4::String*) (qv4context.cpp:383)
==30841==    by 0x8366D91: QV4::Runtime::getActivationProperty(QV4::ExecutionEngine*, int) (qv4runtime.cpp:693)
==30841==    by 0x359D37CC: ???
==30841==    by 0x82E2EB2: QV4::SimpleScriptFunction::call(QV4::Managed*, QV4::CallData*) (qv4functionobject.cpp:564)
==30841==    by 0x821DE13: QV4::Object::call(QV4::CallData*) (qv4object_p.h:302)
==30841==    by 0x841DCA5: QQmlJavaScriptExpression::evaluate(QQmlContextData*, QV4::Value const&, QV4::CallData*, bool*) (qqmljavascriptexpression.cpp:158)
==30841==    by 0x83B0B9F: QQmlBoundSignalExpression::evaluate(void**) (qqmlboundsignal.cpp:281)
==30841==  Address 0x31363790 is 32 bytes inside a block of size 648 free'd
==30841==    at 0x4C2A144: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30841==    by 0x758E059: QQuickWindowPrivate::~QQuickWindowPrivate() (qquickwindow.cpp:428)
==30841==    by 0xBC651DF: QScopedPointerDeleter<QObjectData>::cleanup(QObjectData*) (qscopedpointer.h:54)
==30841==    by 0xBC6379E: QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer() (qscopedpointer.h:101)
==30841==    by 0xBC58CAA: QObject::~QObject() (qobject.cpp:883)
==30841==    by 0xB358A03: QWindow::~QWindow() (qwindow.cpp:202)
==30841==    by 0x7591813: QQuickWindow::~QQuickWindow() (qquickwindow.cpp:1111)
==30841==    by 0x5E0D17B: KQuickAddons::QuickViewSharedEngine::~QuickViewSharedEngine() (quickviewsharedengine.cpp:154)
==30841==    by 0x5075918: PlasmaQuick::ContainmentView::~ContainmentView() (containmentview.cpp:225)
==30841==    by 0x481A68: PanelView::~PanelView() (panelview.cpp:118)
==30841==    by 0x481AA5: PanelView::~PanelView() (panelview.cpp:124)
==30841==    by 0xBC6150A: qDeleteInEventHandler(QObject*) (qobject.cpp:4455)
==30841==  Block was alloc'd at
==30841==    at 0x4C29118: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30841==    by 0x7591420: QQuickWindow::QQuickWindow(QWindow*) (qquickwindow.cpp:1078)
==30841==    by 0x5E0D0CB: KQuickAddons::QuickViewSharedEngine::QuickViewSharedEngine(QWindow*) (quickviewsharedengine.cpp:150)
==30841==    by 0x507549F: PlasmaQuick::ContainmentView::ContainmentView(Plasma::Corona*, QWindow*) (containmentview.cpp:184)
==30841==    by 0x48107F: PanelView::PanelView(ShellCorona*, QScreen*, QWindow*) (panelview.cpp:64)
==30841==    by 0x49AB28: ShellCorona::createWaitingPanels() (shellcorona.cpp:1016)
==30841==    by 0x49F32C: ShellCorona::addPanel(QString const&) (shellcorona.cpp:1526)
==30841==    by 0x49F03F: ShellCorona::addPanel(QAction*) (shellcorona.cpp:1488)
==30841==    by 0x4A06FE: ShellCorona::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_shellcorona.cpp:295)
==30841==    by 0xBC5F9CC: QMetaObject::activate(QObject*, int, int, void**) (qobject.cpp:3713)
==30841==    by 0xBC5F1D7: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3578)
==30841==    by 0xAB593D6: QMenu::triggered(QAction*) (moc_qmenu.cpp:273)
==30841==
Comment 10 David Edmundson 2015-12-23 16:33:14 UTC
and gdb trace of where debug builds crash.

#6  QQmlData::wasDeleted (object=0x24af3a0) at ../../include/QtQml/5.5.1/QtQml/private/../../../../../../../qt5/qtdeclarative/src/qml/qml/qqmldata_p.h:244
#7  0x00007fb71519e4c3 in QV4::QObjectWrapper::wrap (engine=0xe64ef0, object=0x24af3a0) at /home/david/projects/qt5/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:572
#8  0x00007fb7150f507c in QV4::ExecutionEngine::fromVariant (this=0xe64ef0, variant=...) at /home/david/projects/qt5/qtdeclarative/src/qml/jsruntime/qv4engine.cpp:1423
#9  0x00007fb71528150b in QV4::QmlContextWrapper::get (m=0x7fb6e5e0c108, name=0x7fb6e5e0c0e0, hasProperty=0x7ffeeaeba50f) at /home/david/projects/qt5/qtdeclarative/src/qml/qml/qqmlcontextwrapper.cpp:232
#10 0x00007fb715074cd9 in QV4::Object::get (this=0x7fb6e5e0c108, name=0x7fb6e5e0c0e0, hasProperty=0x7ffeeaeba50f) at ../../include/QtQml/5.5.1/QtQml/private/../../../../../../../qt5/qtdeclarative/src/qml/jsruntime/qv4object_p.h:276
#11 0x00007fb715105b5f in QV4::ExecutionContext::getProperty (this=0x7fb6e5e0c0e8, name=0x7fb6e5e0c0e0) at /home/david/projects/qt5/qtdeclarative/src/qml/jsruntime/qv4context.cpp:383
#12 0x00007fb7151bdd92 in QV4::Runtime::getActivationProperty (engine=0xe64ef0, nameIndex=63) at /home/david/projects/qt5/qtdeclarative/src/qml/jsruntime/qv4runtime.cpp:693
#13 0x00007fb657e137cd in ?? ()
#14 0x00007ffeeaeba680 in ?? ()
#15 0x00007fb71513c972 in QV4::Value::cast<QV4::SimpleScriptFunction> (this=0x7fb6e5e0c008) at /home/david/projects/qt5/qtdeclarative/src/qml/jsruntime/qv4value_p.h:372
#16 0x00007fb715139eb3 in QV4::SimpleScriptFunction::call (that=0x7fb6e5e0c000, callData=0x7fb6e5e0c008) at /home/david/projects/qt5/qtdeclarative/src/qml/jsruntime/qv4functionobject.cpp:564
#17 0x00007fb715074e14 in QV4::Object::call (this=0x7fb6e5e0c000, d=0x7fb6e5e0c008) at ../../include/QtQml/5.5.1/QtQml/private/../../../../../../../qt5/qtdeclarative/src/qml/jsruntime/qv4object_p.h:302
#18 0x00007fb715274ca6 in QQmlJavaScriptExpression::evaluate (this=0x4fbde40, context=0x22aa730, function=..., callData=0x7fb6e5e0c008, isUndefined=0x0) at /home/david/projects/qt5/qtdeclarative/src/qml/qml/qqmljavascriptexpression.cpp:158
#19 0x00007fb715207ba0 in QQmlBoundSignalExpression::evaluate (this=0x4fbde20, a=0x0) at /home/david/projects/qt5/qtdeclarative/src/qml/qml/qqmlboundsignal.cpp:281
#20 0x00007fb7152081ed in QQmlBoundSignal_callback (e=0x49dccf8, a=0x0) at /home/david/projects/qt5/qtdeclarative/src/qml/qml/qqmlboundsignal.cpp:408
#21 0x00007fb715253d09 in QQmlNotifier::emitNotify (endpoint=0x0, a=0x0) at /home/david/projects/qt5/qtdeclarative/src/qml/qml/qqmlnotifier.cpp:94
#22 0x00007fb7151dc3f6 in QQmlData::signalEmitted (object=0x2ddba30, index=3, a=0x0) at /home/david/projects/qt5/qtdeclarative/src/qml/qml/qqmlengine.cpp:763
#23 0x00007fb7119933d6 in QMetaObject::activate (sender=0x2ddba30, signalOffset=3, local_signal_index=0, argv=0x0) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qobject.cpp:3599
#24 0x00007fb7119931d8 in QMetaObject::activate (sender=0x2ddba30, m=0x7fb715525fe0 <QQmlTimer::staticMetaObject>, local_signal_index=0, argv=0x0) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qobject.cpp:3578
#25 0x00007fb7153161df in QQmlTimer::triggered (this=0x2ddba30) at .moc/moc_qqmltimer_p.cpp:255
#26 0x00007fb71530151e in QQmlTimer::event (this=0x2ddba30, e=0x4185570) at /home/david/projects/qt5/qtdeclarative/src/qml/types/qqmltimer.cpp:334
#27 0x00007fb7126e65f6 in QApplicationPrivate::notify_helper (this=0x9af6f0, receiver=0x2ddba30, e=0x4185570) at /home/david/projects/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3716
#28 0x00007fb7126e3d55 in QApplication::notify (this=0x7ffeeaebd380, receiver=0x2ddba30, e=0x4185570) at /home/david/projects/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3160
#29 0x00007fb711955056 in QCoreApplication::notifyInternal (this=0x7ffeeaebd380, receiver=0x2ddba30, event=0x4185570) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:965
#30 0x00007fb711958d75 in QCoreApplication::sendEvent (receiver=0x2ddba30, event=0x4185570) at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qcoreapplication.h:224
#31 0x00007fb7119563d2 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x9a5530) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1593
#32 0x00007fb711955d52 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1451
#33 0x00007fb7119ca9ea in postEventSourceDispatch (s=0xa11170) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:271
#34 0x00007fb70c884dc7 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#35 0x00007fb70c885020 in ?? () from /usr/lib/libglib-2.0.so.0
#36 0x00007fb70c8850cc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#37 0x00007fb7119cb1a7 in QEventDispatcherGlib::processEvents (this=0xa13930, flags=...) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:418
#38 0x00007fb703d2d6cc in QPAEventDispatcherGlib::processEvents (this=0xa13930, flags=...) at /home/david/projects/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:115
#39 0x00007fb711951c14 in QEventLoop::processEvents (this=0x7ffeeaebd1d0, flags=...) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:128
#40 0x00007fb711951f08 in QEventLoop::exec (this=0x7ffeeaebd1d0, flags=...) at /home/david/projects/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:204
#41 0x00007fb711955734 in QCoreApplication::exec () at /home/david/projects/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1229
#42 0x00007fb711d5e474 in QGuiApplication::exec () at /home/david/projects/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1527
#43 0x00007fb7126e372f in QApplication::exec () at /home/david/projects/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2976
#44 0x0000000000472a32 in main (argc=1, argv=0x7ffeeaebd998) at /home/david/projects/kde5/src/kde/workspace/plasma-workspace/shell/main.cpp:179



shows we have a timer in a vaild QML scope that still runs after our context property "panel" has been deleted.
Comment 11 David Edmundson 2015-12-27 16:54:07 UTC
*** Bug 357183 has been marked as a duplicate of this bug. ***
Comment 12 David Edmundson 2015-12-27 22:13:05 UTC
Git commit c692bc53a8c5cf5802084085b9aed11203998d38 by David Edmundson.
Committed on 27/12/2015 at 22:12.
Pushed by davidedmundson into branch 'Plasma/5.5'.

Set root context properties on the right context

engine()->rootContext() will give a different result to
rootContext() when using a shared engine.

One being in the right context, the other being the context of the
shared engine. Using the latter means two panels end up sharing the same
object which leads to some interesting results and QML crashes in
QV4::QObjectWrapper::wrap when one gets deleted.

I've tested against 356545, but I think it's the cause of a lot of the
mystery QML bugs we couldn't figure out.
Related: bug 355885, bug 356916
REVIEW: 126491

M  +2    -2    shell/containmentconfigview.cpp
M  +2    -2    shell/panelconfigview.cpp
M  +1    -1    shell/panelview.cpp
M  +2    -2    shell/shellcorona.cpp

http://commits.kde.org/plasma-workspace/c692bc53a8c5cf5802084085b9aed11203998d38
Comment 13 Martin Klapetek 2016-01-05 19:10:23 UTC
*** Bug 357590 has been marked as a duplicate of this bug. ***