Bug 493274 - Endless loop of new thumbnails in /tmp
Summary: Endless loop of new thumbnails in /tmp
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.08.1
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 494984 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-09-17 16:06 UTC by Martin Tůma
Modified: 2024-11-12 08:50 UTC (History)
12 users (show)

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


Attachments
How to reproduce (1.88 MB, video/x-matroska)
2024-09-20 16:59 UTC, Martin Tůma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Tůma 2024-09-17 16:06:13 UTC
When a PNG image is created in /tmp and dolphin opens the folder, every second a new preview image of the PNG (if multiple, than of all of them) is created in /tmp.

Dolphin 24.08.1/openSUSE Tumbleweed
Comment 1 Justin Zobel 2024-09-20 04:34:49 UTC
I am unable to confirm this on Dolphin from git master. I took a screenshot using spectacle, saved it as a PNG, moved that file to /tmp but I don't see any preview images being created.

Can you please attach a screenshot or better yet a screen recording of this happening please?
Comment 2 Martin Tůma 2024-09-20 16:59:56 UTC
Created attachment 173915 [details]
How to reproduce
Comment 3 Martin Tůma 2024-09-20 17:03:38 UTC
In the video there is the original, 100% reproducible way how to start the "dead loop" - by exporting a track from GPXSee. You can also reproduce it by copying a PNG image to /tmp, but the "success rate" is only ~25%. No idea why...
Comment 4 Justin Zobel 2024-09-22 05:47:23 UTC
I am not sure what is creating these thumbnails as it doesn't happen for me with pasting an image in there, I tried it 19 times and no extra thumbnails were generated. Can you please check this happens on a new user account?

Is there any other software running that might be automatically creating thumbnails and storing them in your /tmp folder.

You *might* be able to see whatever is writing to the /tmp by using the iotop command from a terminal, but it's a very small file so it will be very briefly on the screen when it writes.
Comment 5 Martin Tůma 2024-09-22 12:52:03 UTC
On my second computer with Archlinux (same Dolphin version - 24.08.1) I'm not able to reproduce it. Might be configuration-specific or depending on other KDE components. Except KDE there is no other software there that could do it (also note that the loop stops when the dolphin window is closed) and I doubt that some other SW than Dolphin would generate thumbnail images with names like "dolphin-$HASH.png".
Comment 6 Méven Car 2024-09-22 13:25:33 UTC
(In reply to Martin Tůma from comment #5)
> On my second computer with Archlinux (same Dolphin version - 24.08.1) I'm
> not able to reproduce it. Might be configuration-specific or depending on
> other KDE components. Except KDE there is no other software there that could
> do it (also note that the loop stops when the dolphin window is closed) and
> I doubt that some other SW than Dolphin would generate thumbnail images with
> names like "dolphin-$HASH.png".

Is dolphin installed with as a flatpack, or snap, or otherwise contained ?

Do you see thumbnails in ~/.cache/thumbnails in subfolders ?
Comment 7 Ángel Navarro 2024-09-22 16:23:10 UTC
If I open a folder containing photos of videos and wait Dolphin to generate thumbnails and then I go to the /tmp folder, Dolphin starts generating thumbnails for those "dolphin-*" and "plasmashell-*" thumbnails and then generates thumbnails for those thumbnails it had just created and so the loop continues. You need to leave the window open for it to happen so Dolphin will be continuosly creating them. If you open a terminal and run 'watch -n 0.1 sudo du -h -s /tmp', you can see the disk usage growing a bit slowly but then it scales up.

Arch Linux
Comment 8 Méven 2024-09-23 09:03:14 UTC
(In reply to Ángel Navarro from comment #7)
> If I open a folder containing photos of videos and wait Dolphin to generate
> thumbnails and then I go to the /tmp folder, Dolphin starts generating
> thumbnails for those "dolphin-*" and "plasmashell-*" thumbnails and then
> generates thumbnails for those thumbnails it had just created and so the
> loop continues. You need to leave the window open for it to happen so
> Dolphin will be continuosly creating them. If you open a terminal and run
> 'watch -n 0.1 sudo du -h -s /tmp', you can see the disk usage growing a bit
> slowly but then it scales up.
> 
> Arch Linux

I have tested it, this happens because you don't have installed kio-extras which provides the default thumbnailers, that don't write ever to /tmp, the none-default are the ones provided in /usr/share/thumbnailers/
It needs to be special cased.
Comment 9 Bug Janitor Service 2024-09-23 10:36:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1727
Comment 10 Ángel Navarro 2024-09-23 17:25:22 UTC
(In reply to Méven from comment #8)
> (In reply to Ángel Navarro from comment #7)
> > If I open a folder containing photos of videos and wait Dolphin to generate
> > thumbnails and then I go to the /tmp folder, Dolphin starts generating
> > thumbnails for those "dolphin-*" and "plasmashell-*" thumbnails and then
> > generates thumbnails for those thumbnails it had just created and so the
> > loop continues. You need to leave the window open for it to happen so
> > Dolphin will be continuosly creating them. If you open a terminal and run
> > 'watch -n 0.1 sudo du -h -s /tmp', you can see the disk usage growing a bit
> > slowly but then it scales up.
> > 
> > Arch Linux
> 
> I have tested it, this happens because you don't have installed kio-extras
> which provides the default thumbnailers, that don't write ever to /tmp, the
> none-default are the ones provided in /usr/share/thumbnailers/
> It needs to be special cased.

I thought so the first time I had the bug, but I had kio-extras installed and also installing or uninstalling ffmpegthumbnailer/ffmpegthumbs makes no difference
Comment 11 angel 2024-09-30 16:44:11 UTC
I am having the same issue as well, I did the same thing as  I just took an screenshot using spectacle and saved it in /tmp and it immediately started creating copies.

I tried installing kio-extras but it doesn't appear to have done anything. I have installed dolphin from the official arch linux repo.

Dolphin 24.08.1-1/Arch Linux
Comment 12 Ben Adler 2024-10-02 15:32:11 UTC
Just updated arch linux, now have

➜  ~ pacman -Ss kio-extras
extra/kio-extras 24.08.1-1 (kde-applications kde-network) [installed]

and I can reproduce this every time by creating a .png in /tmp while looking at /tmp in dolphin. I just don't know how to paste helpful debug output here, starting dolphin in konsole doesn't print anything helpful. All I saw was

kf.kio.core.connection: Socket not connected QLocalSocket::PeerClosedError
kf.kio.core: An error occurred during write. The worker terminates now.

and I'm not sure if this is related. So, how can I gather relevant debug output?
Comment 13 Jªˢºⁿ 2024-10-12 00:12:11 UTC
(In reply to Martin Tůma from comment #5)
> On my second computer with Archlinux (same Dolphin version - 24.08.1) I'm
> not able to reproduce it. Might be configuration-specific or depending on
> other KDE components. Except KDE there is no other software there that could
> do it (also note that the loop stops when the dolphin window is closed) and
> I doubt that some other SW than Dolphin would generate thumbnail images with
> names like "dolphin-$HASH.png".

On my computer, I am using archlinux, and this issue also happens on my computer (filling my /tmp directory with endless jpg files every half second or so, maybe less) with the latest dolphin 24.08.2-1. I uninstalled dolphin for now, and I'm using krusader as my file manager. kio-extras was already installed prior, and did not stop or help it from happening.
Comment 14 Méven 2024-10-14 16:18:32 UTC
Git commit 1ffb86c9a3f6ccec917efe8fff7b486ac25bc7e1 by Méven Car.
Committed on 14/10/2024 at 16:06.
Pushed by meven into branch 'master'.

Preview: better clean after standard thumbnailer

 * Avoid generating thumbnails for files in /tmp for the
   standardthumbnailer
 * Remove temp file after standard thumbnailer completion or error
 * StandardThumbnailJob starts process only after connection have been
   set
 * StandardThumbnailJob stop process when killed
 * Use a Private class for StandardThumbnailJob

M  +56   -63   src/gui/previewjob.cpp
M  +52   -8    src/gui/standardthumbnailjob.cpp
M  +10   -0    src/gui/standardthumbnailjob_p.h

https://invent.kde.org/frameworks/kio/-/commit/1ffb86c9a3f6ccec917efe8fff7b486ac25bc7e1
Comment 15 TraceyC 2024-10-24 19:00:20 UTC
*** Bug 494984 has been marked as a duplicate of this bug. ***
Comment 16 Alexander Trufanov 2024-11-11 17:04:22 UTC
Same bug on my machine. This requires a bugfix for 6.6.x
```
Operating System: Kubuntu 24.10
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.6.2
Kernel Version: 6.11.0-9-generic (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 9 7940H w/Radeon 780M Graphics
Memory: 30.6 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4070 Laptop GPU/PCIe/SSE2
Manufacturer: TANSHI
Product Name: Gaming series
```
Comment 17 Méven Car 2024-11-12 08:50:34 UTC
(In reply to Alexander Trufanov from comment #16)
> Same bug on my machine. This requires a bugfix for 6.6.x
> ```
> Operating System: Kubuntu 24.10
> KDE Plasma Version: 6.1.5
> KDE Frameworks Version: 6.6.0
> Qt Version: 6.6.2
> Kernel Version: 6.11.0-9-generic (64-bit)
> Graphics Platform: X11
> Processors: 16 × AMD Ryzen 9 7940H w/Radeon 780M Graphics
> Memory: 30.6 GiB of RAM
> Graphics Processor: NVIDIA GeForce RTX 4070 Laptop GPU/PCIe/SSE2
> Manufacturer: TANSHI
> Product Name: Gaming series
> ```
Report it to kubuntu (on launchpad), there are the only one to be able to fix your package through a backport.