Bug 505215 - dolphin file descriptor leak when showing /tmp
Summary: dolphin file descriptor leak when showing /tmp
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (other bugs)
Version First Reported In: git-master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-04 18:27 UTC by alanas.00
Modified: 2025-06-10 08:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
backtrace of openat syscall that returned 42 (one of file descriptors that was never closed) (21.32 KB, text/plain)
2025-06-04 18:27 UTC, alanas.00
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alanas.00 2025-06-04 18:27:40 UTC
Created attachment 182034 [details]
backtrace of openat syscall that returned 42 (one of file descriptors that was never closed)

STEPS TO REPRODUCE
1. open dolphin
2. navigate to /tmp
3. run `ls -v "/proc/$(pidof dolphin)/fd"` every second

OBSERVED RESULT
number of file descriptors keeps increasing

EXPECTED RESULT
number of file descriptors doesn't change

SOFTWARE/OS VERSIONS
qt: https://github.com/qt/qtbase/tree/v6.9.0
kio: https://invent.kde.org/frameworks/kio/-/commit/a2fcfaf75c4e6f28015394df9c4e3aac9afe33f9
kcoreaddons: https://invent.kde.org/frameworks/kcoreaddons/-/commit/dc19e779d300938adfb1a88a34fbdb2e415d8548
dolphin: https://invent.kde.org/system/dolphin/-/commit/a35af3a0d2022a23c5a1cc30d693141a13673b8f

ADDITIONAL INFORMATION
does this code deallocate QTemporaryFile? https://invent.kde.org/system/dolphin/-/blob/a35af3a0d2022a23c5a1cc30d693141a13673b8f/src/views/viewproperties.cpp#L45-96
Comment 1 Akseli Lahtinen 2025-06-04 20:29:11 UTC
Can confirm, will investigate

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.0
Kernel Version: 6.15.0-61.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: AMD Radeon RX 6600
Comment 2 Bug Janitor Service 2025-06-05 08:53:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/983
Comment 3 Akseli Lahtinen 2025-06-09 14:08:44 UTC
Git commit 04e493d78cdf46e64562fe8a302426b1fd8c47df by Akseli Lahtinen.
Committed on 09/06/2025 at 12:55.
Pushed by akselmo into branch 'master'.

viewproperties: Fix leaking file descriptors

File descriptors would keep leaking here since tempFile never gets
deleted. This would be especially noticeable when browsing /tmp/ folder.

This patch makes the QTemporaryFile an unique_ptr, so it gets
deleted when it's out of scope. This also causes the files to be
handled accordingly.

M  +6    -19   src/views/viewproperties.cpp

https://invent.kde.org/system/dolphin/-/commit/04e493d78cdf46e64562fe8a302426b1fd8c47df
Comment 4 Akseli Lahtinen 2025-06-10 08:18:23 UTC
Git commit d19cc92c36fca8fb4cc43089fc64c7a8cce24284 by Akseli Lahtinen.
Committed on 09/06/2025 at 14:42.
Pushed by meven into branch 'release/25.04'.

viewproperties: Fix leaking file descriptors

File descriptors would keep leaking here since tempFile never gets
deleted. This would be especially noticeable when browsing /tmp/ folder.

This patch makes the QTemporaryFile an unique_ptr, so it gets
deleted when it's out of scope. This also causes the files to be
handled accordingly.


(cherry picked from commit 04e493d78cdf46e64562fe8a302426b1fd8c47df)

Co-authored-by: Akseli Lahtinen <akselmo@akselmo.dev>

M  +6    -19   src/views/viewproperties.cpp

https://invent.kde.org/system/dolphin/-/commit/d19cc92c36fca8fb4cc43089fc64c7a8cce24284