Tested on Fedora 22 with muon 5.4.2 + fix for bug #354415 Reproducible: Always Steps to Reproduce: 1. Open muon 2. Search for Abe 3. click 'Install' (It seems to do something, then returns to showing Abe with an 'Install' button.) 4. Click the 'Install' button again (crash) 5. After the crash, run muon again 6. See that Abe is shown as installed 7. Click 'Remove' 8. Enter admin credential (It shows Abe with a 'Install' button) 9. Click the 'Install' button (crash) Actual Results: Muon crash. Expected Results: Muon Install/Remove package without crash. https://bugzilla.redhat.com/show_bug.cgi?id=1274167
fyi Truncated backtrace: Thread no. 1 (10 frames) #0 QtPrivate::RefCount::ref at /usr/include/qt5/QtCore/qrefcount.h:54 #1 QString::QString at /usr/include/qt5/QtCore/qstring.h:878 #2 PackageKitResource::installedPackageId at ../../../../libmuon/backends/PackageKitBackend/PackageKitResource.cpp:68 #3 PackageKitResource::availablePackageId at ../../../../libmuon/backends/PackageKitBackend/PackageKitResource.cpp:63 #4 PKTransaction::start at ../../../../libmuon/backends/PackageKitBackend/PKTransaction.cpp:46 #5 ResourcesModel::qt_static_metacall at moc_ResourcesModel.cpp:157 #6 ResourcesModel::qt_metacall at moc_ResourcesModel.cpp:264 #7 QQmlObjectOrGadget::metacall at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/qml/qqmlpropertycache.cpp:1689 #8 CallMethod at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:1160 #9 CallPrecise at /usr/src/debug/qtdeclarative-opensource-src-5.5.0/src/qml/jsruntime/qv4qobjectwrapper.cpp:1409
Could you try the following patch and tell me what's the added output? diff --git a/libmuon/backends/PackageKitBackend/PackageKitResource.cpp b/libmuon/backends/PackageKitBackend/PackageKitResource.cpp index f1ee811..3f51253 100644 --- a/libmuon/backends/PackageKitBackend/PackageKitResource.cpp +++ b/libmuon/backends/PackageKitBackend/PackageKitResource.cpp @@ -65,6 +65,7 @@ QString PackageKitResource::availablePackageId() const QString PackageKitResource::installedPackageId() const { + qDebug() << "installed" << m_packages; return m_packages[PackageKit::Transaction::InfoInstalled].first(); }
First crash: (after Abe install): Remove transaction: "abe" with 1 transactions running installed QMap() Second crash: (after Abe remove): installed QMap((1, ("abe;1.1-25.fc22;x86_64;installed:fedora"))) Remove transaction: "abe" with 1 transactions running installed QMap()
To clarify: https://www.youtube.com/watch?v=6qa7sZ6t8Uo
I suspect one complication here may be no (or stale) packageKit metadata cache (may explain why I cannot reproduce the problems seen here personally). May be worth : * try running 'pkmon' while performing this test, to see what packagekitd is doing * prior to testing muon, run: pkcon refresh force
Created attachment 95225 [details] pkmon output
the problem seem be caused by PKTransaction::cleanup() exactly this rows: PackageKit::Transaction* t = PackageKit::Daemon::resolve(resource()->packageName(), PackageKit::Transaction::FilterArch | PackageKit::Transaction::FilterLast); qobject_cast<PackageKitResource*>(resource())->resetPackageIds(); connect(t, SIGNAL(package(PackageKit::Transaction::Info,QString,QString)), resource(), SLOT(addPackageId(PackageKit::Transaction::Info, QString,QString))); the "package" signal isn't emitted and the m_packages map remain empty The question is why?
Git commit a24e495c2eea95e76b1389bdffaf27e30d7e273a by Aleix Pol. Committed on 03/11/2015 at 15:54. Pushed by apol into branch 'Plasma/5.4'. Batch resource package id's This way we make sure it stays consistent M +12 -4 libmuon/backends/PackageKitBackend/PKTransaction.cpp M +3 -2 libmuon/backends/PackageKitBackend/PackageKitResource.cpp M +3 -1 libmuon/backends/PackageKitBackend/PackageKitResource.h http://commits.kde.org/muon/a24e495c2eea95e76b1389bdffaf27e30d7e273a
last commit don't fix this, the package signal isn't emitted and the setPackages() pass a empty QMap to PackageKitResource, consequently muon crash if you apply this path: --- a/libmuon/backends/PackageKitBackend/PKTransaction.cpp 2015-11-03 18:17:55.094175121 +0100 +++ b/libmuon/backends/PackageKitBackend/PKTransaction.cpp 2015-11-03 18:55:18.620076119 +0100 @@ -103,13 +103,18 @@ m_trans = nullptr; } PackageKit::Transaction* t = PackageKit::Daemon::resolve(resource()->packageName(), PackageKit::Transaction::FilterArch | PackageKit::Transaction::FilterLast); + + connect(t, SIGNAL(errorCode(PackageKit::Transaction::Error,QString)), this, SLOT(errorFound(PackageKit::Transaction::Error,QString))); + connect(t, &PackageKit::Transaction::package, t, [t](PackageKit::Transaction::Info info, const QString& packageId) { + qDebug() << "package signal emitted"; QMap<PackageKit::Transaction::Info, QStringList> packages = t->property("packages").value<QMap<PackageKit::Transaction::Info, QStringList>>(); packages[info].append(packageId); t->setProperty("packages", qVariantFromValue(packages)); }); connect(t, &PackageKit::Transaction::finished, t, [t, this](PackageKit::Transaction::Exit status, uint runtime){ + qDebug() << "finished signal emitted"; QMap<PackageKit::Transaction::Info, QStringList> packages = t->property("packages").value<QMap<PackageKit::Transaction::Info, QStringList>>(); qobject_cast<PackageKitResource*>(resource())->setPackages(packages); setStatus(Transaction::DoneStatus); in output I receive only "finished signal emitted" and no error message
Can you confirm that `pkcon resolve <package>` where package is the package you're trying to un/install returns something?
yes, it return the package info: Installato abe-1.1-25.fc22.x86_64 (installed:fedora) Scrolling, platform-jumping, ancient pyramid exploring game
Created attachment 95313 [details] fix patch This patch fix problem but I'm not sure this is a correct solution
Git commit 456c5a03b5397f58a4915c40eca3e5ca7225f794 by Aleix Pol. Committed on 05/11/2015 at 15:47. Pushed by apol into branch 'Plasma/5.4'. Fix package resolution after un/installing Thanks a lot to Elia Devito for the patch! M +1 -1 libmuon/backends/PackageKitBackend/PKTransaction.cpp http://commits.kde.org/muon/456c5a03b5397f58a4915c40eca3e5ca7225f794
I have the same problem when I try to install plasma-widget-cwp widget (it doesn't appear in installed softwares) and in "add widget". I also have the same problem hen I try to install weather-widget a part of necessary packages were not installed.