[plasmashell] [Bug 370718] Plasma failed after uninstalling widget

2016-11-02 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=370718

David Edmundson  changed:

   What|Removed |Added

 CC||peter.ullin...@gmail.com

--- Comment #3 from David Edmundson  ---
*** Bug 371992 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 370718] Plasma failed after uninstalling widget

2016-10-16 Thread David Edmundson via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370718

David Edmundson  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED
  Latest Commit||http://commits.kde.org/kpac
   ||kage/cfb69e21fb0aad92f40348
   ||7b4c8a75b2b0bc8041

--- Comment #2 from David Edmundson  ---
Git commit cfb69e21fb0aad92f403487b4c8a75b2b0bc8041 by David Edmundson.
Committed on 16/10/2016 at 12:13.
Pushed by davidedmundson into branch 'master'.

Fix dangling pointer in KPackageJob

A KPackage::Package object uses qexplicitlyshareddata, and it designed
to be kept on the stack and copied. However, PackageJob takes a pointer
to a package, which it later updates, which is expected to exist for the
lifecycle of the job.

This means

Package p = PackageLoader::self()->loadPackage(..);
p.install();

will crash.

Given that, I don't think this is an application error, and but a
library bug.

Both plasmashell installation and uninstallation have this problem:
Related: bug 369935

As Package is not a QObject we can't just use a QWeakPointer, and
we can't just copy the Package in the packagejob as we need to detatch
and update the \*original\* KPackage instance. Also to match behaviour
we need to do this without changing any other
KPackage instances sharing the same shareddata.

Not a neat fix at all, but there aren't many options that work
without breaking API or behaviour.

REVIEW: 129187

M  +31   -1autotests/plasmoidpackagetest.cpp
M  +1-0autotests/plasmoidpackagetest.h
M  +9-0src/kpackage/package.cpp
M  +20   -0src/kpackage/private/package_p.h
M  +12   -1src/kpackage/private/packagejob.cpp

http://commits.kde.org/kpackage/cfb69e21fb0aad92f403487b4c8a75b2b0bc8041

-- 
You are receiving this mail because:
You are watching all bug changes.


[plasmashell] [Bug 370718] Plasma failed after uninstalling widget

2016-10-14 Thread David Edmundson via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370718

David Edmundson  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |CONFIRMED

--- Comment #1 from David Edmundson  ---
Better trace

Thread 1 (Thread 0x7f2edc01cf40 (LWP 26890)):
[KCrash Handler]
#6  0x7f2ed939df46 in std::__atomic_base::operator++
(this=0x7f2ed8892c33 ) at
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../include/c++/6.2.1/bits/atomic_base.h:296
#7  0x7f2ed939df15 in QAtomicOps::ref (_q_value=...) at
/opt/qt5/include/QtCore/qatomic_cxx11.h:265
#8  0x7f2ed939def5 in QBasicAtomicInteger::ref (this=0x7f2ed8892c33
) at
/opt/qt5/include/QtCore/qbasicatomic.h:110
#9  0x7f2ed939ecc4 in QWeakPointer::QWeakPointer
(this=0x7ffdf7952d30, other=...) at
/opt/qt5/include/QtCore/qsharedpointer_impl.h:583
#10 0x7f2ed939ec53 in QWeakPointer::operator= (this=0x6074098,
other=...) at /opt/qt5/include/QtCore/qsharedpointer_impl.h:596
#11 0x7f2ed939d6af in QPointer::operator=
(this=0x6074098) at /opt/qt5/include/QtCore/qpointer.h:53
#12 0x7f2ed939ad3a in KPackage::PackagePrivate::operator= (this=0x6074090,
rhs=...) at
/home/david/projects/kde5/src/frameworks/kpackage/src/kpackage/package.cpp:854
#13 0x7f2ed939accd in KPackage::PackagePrivate::PackagePrivate
(this=0x6074090, other=...) at
/home/david/projects/kde5/src/frameworks/kpackage/src/kpackage/package.cpp:834
#14 0x7f2ed939fe96 in
QExplicitlySharedDataPointer::clone
(this=0x7ffdf7950b50) at /opt/qt5/include/QtCore/qshareddata.h:248
#15 0x7f2ed939fdf9 in
QExplicitlySharedDataPointer::detach_helper
(this=0x7ffdf7950b50) at /opt/qt5/include/QtCore/qshareddata.h:254
#16 0x7f2ed939b8df in
QExplicitlySharedDataPointer::detach
(this=0x7ffdf7950b50) at /opt/qt5/include/QtCore/qshareddata.h:147
#17 0x7f2ed9398437 in KPackage::Package::setPath (this=0x7ffdf7950b48,
path=...) at
/home/david/projects/kde5/src/frameworks/kpackage/src/kpackage/package.cpp:456
#18 0x7f2ed93ab17f in KPackage::PackageJob::PackageJob(KPackage::Package*,
QObject*)::$_0::operator()(QString const&) const (this=0x77d2ea0,
installPath=...) at
/home/david/projects/kde5/src/frameworks/kpackage/src/kpackage/private/packagejob.cpp:46
#19 0x7f2ed93ab131 in QtPrivate::FunctorCall,
QtPrivate::List, void,
KPackage::PackageJob::PackageJob(KPackage::Package*,
QObject*)::$_0>::call(KPackage::PackageJob::PackageJob(KPackage::Package*,
QObject*)::$_0&, void**) (f=..., arg=0x5d49550) at
/opt/qt5/include/QtCore/qobjectdefs_impl.h:137
#20 0x7f2ed93ab101 in
QtPrivate::Functor::call(KPackage::PackageJob::PackageJob(KPackage::Package*, QObject*)::$_0&,
void*, void**) (f=..., arg=0x5d49550) at
/opt/qt5/include/QtCore/qobjectdefs_impl.h:194
#21 0x7f2ed93ab0ad in
QtPrivate::QFunctorSlotObject::impl(int,
QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1,
this_=0x77d2e90, r=0x7bb6050, a=0x5d49550, ret=0x0) at
/opt/qt5/include/QtCore/qobject_impl.h:168
#22 0x7f2ed519a587 in QtPrivate::QSlotObjectBase::call (this=0x77d2e90,
r=0x7bb6050, a=0x5d49550) at
../../include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qobject_impl.h:101
#23 0x7f2ed518f9f1 in QMetaCallEvent::placeMetaCall (this=0x67331b0,
object=0x7bb6050) at
/run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/corelib/kernel/qobject.cpp:500
#24 0x7f2ed5190ae2 in QObject::event (this=0x7bb6050, e=0x67331b0) at
/run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/corelib/kernel/qobject.cpp:1263
#25 0x7f2ed5c7c460 in QApplicationPrivate::notify_helper (this=0x2443500,
receiver=0x7bb6050, e=0x67331b0) at
/run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3741
#26 0x7f2ed5c7984a in QApplication::notify (this=0x7ffdf7954690,
receiver=0x7bb6050, e=0x67331b0) at
/run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3101
#27 0x7f2ed5156568 in QCoreApplication::notifyInternal2
(receiver=0x7bb6050, event=0x67331b0) at
/run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:988
#28 0x7f2ed515a5d4 in QCoreApplication::sendEvent (receiver=0x7bb6050,
event=0x67331b0) at
../../include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qcoreapplication.h:231
#29 0x7f2ed5157987 in QCoreApplicationPrivate::sendPostedEvents
(receiver=0x0, event_type=0, data=0x2439980) at