Bug 521200 - Setting AVIF icon for a desktop-entry on desktop view causes plasmashell to freeze with 100% CPU
Summary: Setting AVIF icon for a desktop-entry on desktop view causes plasmashell to f...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-08 10:22 UTC by phil4000n
Modified: 2026-06-12 16:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.28
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description phil4000n 2026-06-08 10:22:32 UTC
DESCRIPTION
Warning to test this bug, better to put the avif file on a partition that is NOT mounted at boot/logging.

If you create a desktop entry which icon is an avif image, it will eat all your CPU ressources (core i5) to a point that to take back control you need to switch off.

STEPS TO REPRODUCE
1. Have an avif image on a NON automounted partition and name it eatsAllCPUpower.avif

2. Create the desktop entry:
do_not_put_on_automount_partition.deskop
And have icon as 
Icon=/warning/no/automounted/eatsAllCPUpower.avif

3. save the file and now your CPU (at least my Core i5) start to go full max.
To a point, I physically switched of my laptaop (couldn't get back loggout menu)

EXPECTED RESULT
Should not eat all CPU ressources.

SOFTWARE/OS VERSIONS
OS: Manjaro KDE 26.1.0-pre 
KDE Plasma Version: 6.6.5
KDE Gear 26.04.1
KDE Frameworks 6.26.0
Qt Version: 6.11
kdegraphics-thumbnailers 26.04.1-1


ADDITIONAL INFORMATION
See https://bugs.kde.org/show_bug.cgi?id=521199
Comment 1 Akseli Lahtinen 2026-06-09 09:41:17 UTC
Oh wow, can confirm. When I tried to use avif image through the icon picker when creating the desktop file, plasmashell just completely froze.

Operating System: KDE Linux 2026-06-08
KDE Plasma Version: 6.7.80
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
Kernel Version: 7.0.11-arch1-1 (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 phil4000n 2026-06-10 08:08:59 UTC
Should this be raised as Critical bug in case the avif is link at boot, as I see no other way for the user/server can escape, than to re-install Linux.
Comment 3 Akseli Lahtinen 2026-06-10 10:07:56 UTC
(In reply to phil4000n from comment #2)
> Should this be raised as Critical bug in case the avif is link at boot, as I
> see no other way for the user/server can escape, than to re-install Linux.

Not necessarily, user can enter TTY and delete it from there. Not ideal though. I think major is good here, I will try to fix this asap.
Comment 4 Akseli Lahtinen 2026-06-10 11:28:55 UTC
Hm this might be bug in Qt.. Using GDB, it seems to get stuck in this while loop:
 https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qicon.cpp?h=6.11#n470
Comment 5 Akseli Lahtinen 2026-06-10 11:29:49 UTC
QPixmapIconEngine::addFile (this=0x555556318ec0, fileName=..., size=..., mode=QIcon::Normal, state=QIcon::Off)
    at /usr/src/debug/qt6-base/qtbase/src/gui/image/qicon.cpp:469
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
470                     } while (imageReader.jumpToNextImage());
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
50          QSize size() const { return m_reader.size(); }
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
470                     } while (imageReader.jumpToNextImage());
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
50          QSize size() const { return m_reader.size(); }
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
470                     } while (imageReader.jumpToNextImage());
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
50          QSize size() const { return m_reader.size(); }
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
(gdb) 
470                     } while (imageReader.jumpToNextImage());
(gdb) 
469                         pixmaps += QPixmapIconEngineEntry(abs, imageReader.size(), mode, state);
Comment 6 Akseli Lahtinen 2026-06-10 11:32:16 UTC
With deeper digging i found `kimageformats/src/imageformats/avif.cpp:1137`
Comment 7 Bug Janitor Service 2026-06-10 12:07:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/512
Comment 8 Akseli Lahtinen 2026-06-10 12:55:38 UTC
Git commit 7edf807082286279d8962323a0378d566361031b by Akseli Lahtinen.
Committed on 10/06/2026 at 12:05.
Pushed by akselmo into branch 'master'.

avif: If we only have single image, return false at jumpToNextImage

We were errorneously returning true here, as we do not have any more
images to jump to. If we only have one image, return false.

This avoids the avif handler getting stuck in a loop with only single images.
FIXED-IN: 6.28

M  +1    -1    src/imageformats/avif.cpp

https://invent.kde.org/frameworks/kimageformats/-/commit/7edf807082286279d8962323a0378d566361031b
Comment 9 phil4000n 2026-06-11 10:28:40 UTC
>FIXED-IN: 6.28
Thanks

Because, the code is now fresh in your mind:
* you also confirmed bug: https://bugs.kde.org/show_bug.cgi?id=521199
* and a feature: https://bugs.kde.org/show_bug.cgi?id=521201

Effeciency request, bulk work :-)
Comment 10 Marco Martin 2026-06-11 13:57:00 UTC
Git commit 950a461fd322edd7b2b9e1994a56dd798cae7e89 by Marco Martin.
Committed on 11/06/2026 at 13:55.
Pushed by mart into branch 'Frameworks/6.24'.

avif: If we only have single image, return false at jumpToNextImage

We were errorneously returning true here, as we do not have any more
images to jump to. If we only have one image, return false.

This avoids the avif handler getting stuck in a loop with only single images.
FIXED-IN: 6.28


(cherry picked from commit 7edf807082286279d8962323a0378d566361031b)

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

M  +1    -1    src/imageformats/avif.cpp

https://invent.kde.org/frameworks/kimageformats/-/commit/950a461fd322edd7b2b9e1994a56dd798cae7e89