Bug 416495 - Device::allDevices keeps growing in size with udisks2
Summary: Device::allDevices keeps growing in size with udisks2
Status: RESOLVED FIXED
Alias: None
Product: frameworks-solid
Classification: Unclassified
Component: general (show other bugs)
Version: 5.66.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-20 12:00 UTC by Harald Sitter
Modified: 2020-08-04 07:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.73


Attachments
example app (7.16 KB, application/gzip)
2020-01-20 12:00 UTC, Harald Sitter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2020-01-20 12:00:06 UTC
Created attachment 125260 [details]
example app

listen to deviceAdded and deviceRemoved, run Solid::Device::allDevices().count() each time

STEPS TO REPRODUCE
1. see example code
2. run
3. attach thumb drive
4. remove
5. add
6. remove

OBSERVED RESULT
see overall device count of Device::allDevices go up and up and up. it looks to me that all disk devices simply get duplicated each time. this ultimately results in at least part of the defect described in bug #399746 where kinfocenter will display garbage entries. this is because kinfocenter listens to the notifications but then always runs through the entire allDevices list to inject new devices into the treeview, as such each time devices get duplicated the list in kinfocenter grows.

EXPECTED RESULT
device count doesn't keep growing

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.66.0
Qt Version: 5.13.2
Kernel Version: 5.5.0-050500rc5-generic
OS Type: 64-bit
Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor
Memory: 15,6 GiB of RAM
Comment 1 Bug Janitor Service 2020-07-29 14:47:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/solid/-/merge_requests/11