Bug 486349 - .svg file causes huge memory leak if preview and SVG thumbnailer are activated in Dolphin
Summary: .svg file causes huge memory leak if preview and SVG thumbnailer are activate...
Status: REPORTED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-30 15:33 UTC by Patrick Silva
Modified: 2024-05-23 17:37 UTC (History)
4 users (show)

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


Attachments
.svg file (6.23 KB, image/svg+xml)
2024-04-30 16:58 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2024-04-30 15:33:18 UTC
STEPS TO REPRODUCE
1. open Screen Locking KCM
2. maximize System Settings
3. click on "Configure..." button

OBSERVED RESULT
huge memory leak, the system hags for a few seconds until the process that causes the memory leak is killed and the System Settings closes. journal log prints these messages:

r-1003.slice/user@1003.service/app.slice/app-systemsettings-ba3c1e5ebbe84b08894a3a1a259e036e.scope,task=kioworker,pid=12167,uid=1003
abr 30 12:27:10 Arch-PC kernel: Out of memory: Killed process 12167 (kioworker) total-vm:14270128kB, anon-rss:10308760kB, file-rss:0kB, shmem-rss:0kB, UID:1003 pgtables:20768kB oom_score_adj:200
abr 30 12:27:09 Arch-PC systemd[838]: app-systemsettings-ba3c1e5ebbe84b08894a3a1a259e036e.scope: A process of this unit has been killed by the OOM killer.
abr 30 12:27:09 Arch-PC systemd[1]: user@1003.service: A process of this unit has been killed by the OOM killer.
abr 30 12:27:10 Arch-PC systemd[838]: app-systemsettings-ba3c1e5ebbe84b08894a3a1a259e036e.scope: Failed with result 'oom-kill'.
abr 30 12:27:10 Arch-PC systemd[838]: app-systemsettings-ba3c1e5ebbe84b08894a3a1a259e036e.scope: Consumed 5.733s CPU time.
abr 30 12:27:11 Arch-PC systemd-journald[212]: Under memory pressure, flushing caches.


EXPECTED RESULT
no memory leak

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Graphics Platform: Wayland
Comment 1 Patrick Silva 2024-04-30 15:39:13 UTC
Can also reproduce with these steps:
1. right-click on desktop and choose "Configure desktop and wallpaper..."
2. maximize the desktop settings

Plasma crashes after the steps above.

OR

1. open Wallpaper KCM
2, maximize the System Settings

My wallpaper type is set to "Image".
Comment 2 fanzhuyifan 2024-04-30 16:07:23 UTC
can't reproduce on dev build, arch linux, wayland. Maybe some particular wallpaper(s) are causing the issue?
Comment 3 Patrick Silva 2024-04-30 16:58:39 UTC
Created attachment 169036 [details]
.svg file

Its possible. journallog prints this when I open the wallapaper settings:

abr 30 13:10:27 Arch-PC plasmashell[12622]: libKExiv2: Cannot load metadata from file   (Error # %1: The file contains data of an unknown image type )

The memory leak also occurs when I scroll the list of wallpapers while the wallpaper settings is not maximized.

I have found the culprit: the .svg file that comes together the wallpapers of Sweet Global theme.

Download the attached .svg file, copy it to /home/your_user/.local/share/wallpapers/ and try to reproduce the bug.
This .svg file even makes Dolphin to crash if its previews feature is activated and "SVG Images" is checked in "Previews" tab of Dolphin settings.
Comment 4 Till Seifert 2024-05-23 17:37:53 UTC
I have a similar, maybe same issue with current neon:

* when opening in image in a folder with many simple but largish (dimensionwise; 5000x5000px viewbox) SVG files.
* Gwenview will display the image and start loading previews of the other images in the folder in bar at the bottom
* kioworker process appears and consumes memory of ~2GB/second.
* it gets killed by oomkiller when it hits ~50GB
* some thumbnails appear in gwenview, but not all

i can provide a test folder if needed to repro