Bug 512234 - Krita Segfault on attempting to open JPG file from filesystem
Summary: Krita Segfault on attempting to open JPG file from filesystem
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 5.2.13
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2025-11-17 08:57 UTC by savyblizz
Modified: 2025-11-17 23:09 UTC (History)
2 users (show)

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


Attachments
various system info + gdb debug logs (5.47 KB, application/x-7z-compressed)
2025-11-17 08:57 UTC, savyblizz
Details
example working file (731.90 KB, image/jpeg)
2025-11-17 23:06 UTC, savyblizz
Details
example segfault inducing file (144.08 KB, image/png)
2025-11-17 23:07 UTC, savyblizz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description savyblizz 2025-11-17 08:57:28 UTC
Created attachment 186877 [details]
various system info + gdb debug logs

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
After trying to open a specific file (using the open image button in Krita), the program crashes. The cause seems to be related to "plugins/impex/heif/kis_heif_import_tools_AVX2+FMA"

STEPS TO REPRODUCE
1. Download the jpg here: https://cdn.sanity.io/images/4o5apavh/production/4935e46a3ed959991c1c2c60cb8053486dd88c17-3000x3000.jpg?fit=max&auto=format&auto=format
1.1 (before you ask questions, source is from the music artist's website page here: https://surfgang.nyc/releases/april-mixtape-3)
2. Open Krita
3.  Select "Open Image" or "Open Document"
4. Try opening the aforementioned image

OBSERVED RESULT
After step 4, the program closes.

EXPECTED RESULT
It should open the file into an editing page after step 3

SOFTWARE/OS VERSIONS
Windows: n/a
macOS: n/a
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Fedora Linux 42 (Silverblue)
KDE Plasma Version: n/a
KDE Frameworks Version:  n/a
Qt Version: 6.9.3

ADDITIONAL INFORMATION
file info:
md5sum: a497af5784abd07ffc3ee7c83a0fec64  
filename: 4935e46a3ed959991c1c2c60cb8053486dd88c17-3000x3000.jpg

This was recreated on my friend's windows 11 OS system. 

I recreated this with other images from the website. Surfgang is doing something weird with their images. Another example here: https://surfgang.nyc/releases/west-adams
Comment 1 Dmitry Kazakov 2025-11-17 09:38:32 UTC
Okay, I cannot reproduce in master or krita/5.2. Sounds really weird. The most weird thing is why heif plugin is used to load a jpg image? Can it be some flathub issue?

Though there is a line that the bug is reproducible on Win11, which should rule out the flathub cause. Though I haven't tested the Win11 version.
Comment 2 Halla Rempt 2025-11-17 12:04:04 UTC
I checked too, and it really is a jpg image, too.  I've also checked with Windows (10, haven't got 11) and couldn't reproduce either.
Comment 3 savyblizz 2025-11-17 23:04:38 UTC
One clarification: my other friend misinformed me. He was also using fedora 42 silverblue, not windows 11, when he tested for me. 

@Dimitry I would go back to the assumption that it might be related to flathub. However, the fact that the heif plugin is used to load a jpg image remains the most unusual aspect of this issue to me.

More findings:
I tested with other jpg files and didn't seem to have an issue. 
This same issue happens with png files from that website. So it's not actually unique to jpg as far as I can tell. (refer to the second link i provided at the end: https://surfgang.nyc/releases/west-adams -> rclick image -> save)
I tried testing changing the file name both for broken and working files, same behavior.
Comment 4 savyblizz 2025-11-17 23:06:25 UTC
Created attachment 186900 [details]
example working file

opening this file works as expected
Comment 5 savyblizz 2025-11-17 23:07:09 UTC
Created attachment 186901 [details]
example segfault inducing file

this file can (or should) be able to be used to induce the segfault
Comment 6 savyblizz 2025-11-17 23:09:48 UTC
The file is uploaded as a png, but downloaded as an avif. It still generates a segfault.