Summary: | The QListWidget crashes and/or corrupts its list when I drag/drop items with icons. | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | bkimerer |
Component: | generic-crash | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fabian, jan-bugs, kde, kde |
Priority: | NOR | ||
Version: | 5.12.2 | ||
Target Milestone: | 1.0 | ||
Platform: | Mageia RPMs | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kiconthemes/3501660aa3d7ffc83597b0ca7ba33767f0124429 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Source code for the WidgedListCrash program. |
Description
bkimerer
2018-10-18 14:53:52 UTC
I can confirm the crash with Breeze, Fusion, and Oxygen style when running in a Plasma environment. It does not crash when running without Plasma's Platform Integration. Found where we the problem occurs, but not why QDataStream &operator>>(QDataStream &s, QIcon &icon) finds the relevant IconEngine and asks it to serialise. We serialise fine. When we deserialise, suddenly we can't find our engine any more. We know the engine's key is "KIconEngine" correctly, but const int index = loader()->indexOf(key); fails to find us. From what I can see that doesn't include loaders loaded from the QPT. Will be a Qt fix. Or we add a KIconEngine plugin, just like libqsvgicon.so. There are multiple bugs that lead to this crash: - QIcon can't create a KIconEngine - but whether that's a bug is not clear - QIcon's deserialization operator ignores that the engine didn't get created - QAbstractItemModel::decode data doesn't sanitize values This is the bug I reported to Qt back in the day: https://bugreports.qt.io/browse/QTBUG-63546 Here's a patch which adds an icon engine plugin: https://phabricator.kde.org/D16305 With this installed the PoC works just fine. The items get copied to the other side and keep their icons. Git commit 3501660aa3d7ffc83597b0ca7ba33767f0124429 by Fabian Vogt. Committed on 02/11/2018 at 12:25. Pushed by fvogt into branch 'master'. Add a QIconEnginePlugin to allow QIcon deserialization Summary: This is necessary to allow QIcons with a KIconEngine as engine to deserialize properly. Test Plan: Ran the PoC in the bug report, works fine. Reviewers: #frameworks, davidedmundson Reviewed By: davidedmundson Subscribers: lbeltrame, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D16305 M +10 -0 src/CMakeLists.txt A +43 -0 src/kiconengineplugin.cpp [License: LGPL (v2)] A +4 -0 src/kiconengineplugin.json https://commits.kde.org/kiconthemes/3501660aa3d7ffc83597b0ca7ba33767f0124429 |