Summary: | Muon crash when locking package at current version and pressing „Full upgrade” | ||
---|---|---|---|
Product: | [Unmaintained] muon | Reporter: | Sergiu Bivol <sergiu> |
Component: | muon | Assignee: | Jonathan Thomas <echidnaman> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | aleixpol, silhusk, sitter, stasnel |
Priority: | NOR | Keywords: | drkonqi |
Version: | 2.1.3 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/muon/a437d39e43112a3e61ebafadd4e3a06b9bd91437 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
use signal to catch when cache is reloaded
emit cache reload signal in libqapt |
Description
Sergiu Bivol
2014-03-24 22:00:00 UTC
Created attachment 94681 [details]
use signal to catch when cache is reloaded
After some debugging, here is my view on the problem. First some facts:
- PackageWidget uses a PackageModel, which keeps an internal list of (pointers to) packages
- pinning/un-pinning a package causes the apt cache to be reloaded by the backend
- reloading the cache means that all Package objects are deleted, and new ones are created
When a package is (un-)pinned through the right-click menu for instance, the widget where we request the action knows it has to reset itself and clear its model. If we do this in the "review changes" tab instead of the "package manager" tab, we have two existing instances of PackageWidget: one for each tab, although only one is visible. The problem is that only the widget in "review changes" does reset itself (i.e. the one where we click), the other one will keep pointers and iterators to old objects.
The patch proposed here uses signals to get notified when the cache is reloaded. But it requires patching libqapt to emit those signals.
Alternatives:
- destroy "package manager" when "review changes" is shown, and always have only one PackageWidget at a time
- disable package status changes in "review changes"
Issues still open after patching:
- search box keeps text after reload, but filter is cleared
- after cache reload any change (install/uninstall/purge/...) is reset
Created attachment 94682 [details]
emit cache reload signal in libqapt
This is the change required in libqapt for the muon patch to work
Git commit a437d39e43112a3e61ebafadd4e3a06b9bd91437 by Carlo Vanini. Committed on 03/03/2016 at 08:53. Pushed by vanini into branch 'master'. Connect to backend signals to catch cache reload. When the cache is reloaded libqapt deletes Package objects and creates them anew. This results in dangling pointers in muon models. When "Preview Changes" is shown we have two models with lists of packages, and both should be cleared and repopulated. The cache reload can be triggered by pinning/unpinning (lock/unlock) a package. REVIEW: 127107 M +2 -0 src/MainWindow.cpp M +13 -1 src/PackageModel/PackageWidget.cpp M +2 -0 src/PackageModel/PackageWidget.h M +2 -0 src/StatusWidget.cpp http://commits.kde.org/muon/a437d39e43112a3e61ebafadd4e3a06b9bd91437 |