Bug 481702 - Slow and high CPU when folder contain big ".desktop" file(s)
Summary: Slow and high CPU when folder contain big ".desktop" file(s)
Status: ASSIGNED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-22 22:52 UTC by René Paw Christensen
Modified: 2025-09-19 13:19 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description René Paw Christensen 2024-02-22 22:52:56 UTC
SUMMARY
Dolphin tries to process ".desktop" file, even when it is not a text file, and when it is big.
This results in a unresponsive window.
The solution is to set a size limit, on how big ".desktop" files Dolphin should process.

STEPS TO REPRODUCE
1. Create a folder and copy a big file to it (150 MB)
2. Rename the file to ".desktop" or ".Desktop" extension
3. Browse the folder in Dolphin

OBSERVED RESULT
The window does not respond, the CPU goes high.
I expect that Dolphin tries to process the big file, because it thinks it is a text ".desktop" file.

EXPECTED RESULT
Dolphin ignorees (do not process) big ".desktop" files, perhaps > 1 MB.

SOFTWARE/OS VERSIONS
Dolphin: 24.02.0
Linux/KDE Plasma: 6.0.0
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Nothing.
Comment 1 mclangus 2025-03-25 21:51:07 UTC
I can reproduce this on git master. If I change the extension of a large file to .desktop (>10mb) and open its containing folder in dolphin, it freezes up because it opens it as a desktop file in KFileItem::overlays(), which leads to the entire file being parsed in KConfigIniBackend::parseConfig().

Should this be moved from dolphin to frameworks-kio or frameworks-kconfig?
Comment 2 Méven 2025-09-10 14:10:33 UTC
Out of curiosity.
In which circumstances would you have a >1MB .desktop file ?
Is it binary ?
Comment 3 René Paw Christensen 2025-09-10 17:55:48 UTC
(In reply to Méven from comment #2)
> Out of curiosity.
> In which circumstances would you have a >1MB .desktop file ?
> Is it binary ?

It was a DotNet single file like `app.android` and `app.desktop` etc. When you execute the file, it extracts the DotNet runtime and all program files. But even if the program was not a single file with the runtime, DotNet don't use `app.exe` on Linux, but nothing `app` and a `app.dll`.

Anyway, in my opinion we must keep focus on the fact that a file manager should *not* freeze in such a way, just because a file is using the `.desktop` or any other extension. I have seen many examples on Stack Overflow where someone asks a question, and some people focus on the *why* instead of *how do we fix*. The *why* is okay, but should be the secondary focus.
Comment 4 Bug Janitor Service 2025-09-19 11:13:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfig/-/merge_requests/391