Created attachment 189743 [details] GDB Backtrace SUMMARY Krita 5.3.0, 6.0.0 beta 1, and 6.0.0 beta 2 crash on Fedora 41 with an out_of_range exception STEPS TO REPRODUCE 1. Open the Krita AppImage from the terminal 2. Crash OBSERVED RESULT Krita crashes when opening the AppImage EXPECTED RESULT Krita should not crash SOFTWARE/OS VERSIONS OS: Fedora Linux 41 (wayland) Compositor: hyprland ADDITIONAL INFORMATION Backtrace is in the attachment
The crash happens because of this line: https://invent.kde.org/graphics/krita/-/blob/master/libs/flake/text/KoFontRegistry.cpp#L548 FT_New_Face returns failure, hence `lengths` and `faces` vectors start to have different sizes, which is wrong. So, the bug has two parts: 1) Make sure that `lengths` and `faces` have the same size even when FT_New_Face returns failure (either be inserting a fallback face, or modifying both vectors) 2) Find out why FT_New_Face returns failure, is it our own fault?
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2690
Git commit aa8c8c9d70b595fc77baffcec1979e81847e3cd7 by Dmitry Kazakov, on behalf of Wolthera van Hövell. Committed on 11/03/2026 at 09:27. Pushed by dkazakov into branch 'master'. Ensure length and font list is similar and catch freetype errors Sometimes the font doesn't load, and then there's a mismatch in font and length sizes, causing a crash. We try to make sure these values are the same, log an error when the font cannot be loaded, and try to use a previous or fallback font when a font cannot be loaded. M +75 -17 libs/flake/text/KoFontRegistry.cpp https://invent.kde.org/graphics/krita/-/commit/aa8c8c9d70b595fc77baffcec1979e81847e3cd7
Git commit 2047cbd6557a509649b941ae8dfdb8ddd683e575 by Dmitry Kazakov. Committed on 11/03/2026 at 09:27. Pushed by dkazakov into branch 'krita/6.0'. Ensure length and font list is similar and catch freetype errors Sometimes the font doesn't load, and then there's a mismatch in font and length sizes, causing a crash. We try to make sure these values are the same, log an error when the font cannot be loaded, and try to use a previous or fallback font when a font cannot be loaded. (cherry picked from commit aa8c8c9d70b595fc77baffcec1979e81847e3cd7) 9e40160c Ensure length and font list is similar, add ability to identify freetype error. 3bb2f4e6 Add assert in KoFontRegistry, ensure the fallback font has it's fontsize configured. Co-authored-by: Wolthera van Hövell <griffinvalley@gmail.com> M +75 -17 libs/flake/text/KoFontRegistry.cpp https://invent.kde.org/graphics/krita/-/commit/2047cbd6557a509649b941ae8dfdb8ddd683e575