Bug 478017 - Krita crashes on opening an animation file
Summary: Krita crashes on opening an animation file
Status: RESOLVED DOWNSTREAM
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 5.2.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-04 01:01 UTC by Aleksandr Beliaev
Modified: 2023-12-21 03:58 UTC (History)
2 users (show)

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


Attachments
KDE crash report (8.91 KB, text/vnd.kde.kcrash-report)
2023-12-04 01:01 UTC, Aleksandr Beliaev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksandr Beliaev 2023-12-04 01:01:56 UTC
Created attachment 163832 [details]
KDE crash report

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Install the most recent version from Arch repo
2. Start krita, pick up a reasonably large *.kra file (~40-50 MB).

OBSERVED RESULT
Signal 6 with 100% probability. Following is the console output:

user@home:~$ krita
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
kf.config.core: Watching absolute paths is not supported "/usr/share/color-schemes/KritaDark.colors"
krita.lib.pigment: Replacing color space factory "LABA" "L*a*b* (16-bit integer/channel, unmanaged)" with "LABA" "L*a*b*/Alpha (16-bit integer/channel)"
krita.lib.pigment: Replacing color space factory "RGBA" "RGB (8-bit integer/channel, unmanaged)" with "RGBA" "RGB/Alpha (8-bit integer/channel)"
krita.lib.pigment: Replacing color space factory "RGBA16" "RGB (16-bit integer/channel, unmanaged)" with "RGBA16" "RGB/Alpha (16-bit integer/channel)"
QObject::startTimer: Timers cannot have negative intervals
/usr/lib/krita-python-libs/krita added to PYTHONPATH
krita.lib.widgetutils: KoFileDialog: No default suffix for 'All supported formats'
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_REPOSITORY")" in file /usr/src/debug/krita/krita-5.2.1/libs/ui/KisPlaybackEngineMLT.cpp, line 363
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_PROFILES_PATH")" in file /usr/src/debug/krita/krita-5.2.1/libs/ui/KisPlaybackEngineMLT.cpp, line 364
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_PRESETS_PATH")" in file /usr/src/debug/krita/krita-5.2.1/libs/ui/KisPlaybackEngineMLT.cpp, line 365
ASSERT (krita): "producer->is_valid()" in file /usr/src/debug/krita/krita-5.2.1/libs/ui/KisPlaybackEngineMLT.cpp, line 372
19 -- exe=/usr/bin/krita
13 -- platform=xcb
11 -- display=:0
14 -- appname=krita
17 -- apppath=/usr/bin
9 -- signal=6
11 -- pid=282671
17 -- appversion=5.2.1
18 -- programname=Krita
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = krita path = /usr/bin pid = 282671
KCrash: Arguments: /usr/bin/krita
KCrash: Attempting to start /usr/lib/drkonqi
QSystemTrayIcon::setVisible: No Icon set


EXPECTED RESULT
File is opened, user can edit their animations

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: plasma-desktop-5.27.9-1
KDE Frameworks Version: 23.08-1
Qt Version: 5.15.11+kde+r147-1

ADDITIONAL INFORMATION
I've submitted report to Arch, as initially was not able to reproduce the issue with AppImage binary. 
See here: https://gitlab.archlinux.org/archlinux/packaging/packages/krita/-/issues/1

After conversation with maintainer and performing of some extra tests (I unpacked AppImage, switched to chroot environment, ran it via strace, collected ~200 MB logs) I've got pretty the same error.
Please find crash report in attachment.
Comment 1 Alvin Wong 2023-12-14 16:55:38 UTC
If I understand correctly, probably the Arch package is missing the MLT plugin which is currently in the 3rdparty/ folder and built as part of our deps tree (as a fork of upstream MLT), instead of being in the main source tree. MR 2032 is relevant, but technically this is still an issue with the upstream Arch package. I am not sure what's the temporary fix though.

@Emmet, is the Qt playback engine still here and can distro packages enable it instead?

MR 2032: https://invent.kde.org/graphics/krita/-/merge_requests/2032
Comment 2 Emmet O'Neill 2023-12-21 03:58:29 UTC
@Aleksandr:

Hey there.

First, technically the only supported means of getting Krita is via the official AppImages that we generate, or from the various "app stores" that we officially distribute on (Steam, Windows Store, EGS, Android's App Store). So, personally, I would recommend using the AppImage version of Krita for the most consistent experience. (Of course Krita is FOSS and available in many other formats and repositories, and we want it to be working correctly in those places too, but much of that is going to be in the hands of the repository maintainers.)

With that said, based on your backtrace it's possible that there's a problem with how Krita is being packaged on Arch with regard to MLT. Right now we're shipping a fork of MLT with a custom plugin for handling animation audio, and so If I had to guess, I'd say that the wrong version of MLT is being used on Arch. 

In other words, this is a bug for the Arch package maintainer(s), though to be fair we haven't exactly made it easy on them. :(

I should also mention that I'm in the process of improving this (as much as possible) so that our custom MLT plugin is shipping in our own source tree, while other changes are upstreamed so that we can use the regular MLT instead of maintaining our own fork. So, fwiw, we're working on improving and simplifying things. (This work should be merged soon (tm)--taking into account Christmas and New Years and all that.) 

@Alvin:

Yeah, we still have a KisPlaybackEngineQt, which should work just fine other than it no longer supports audio. 
(Mainly so we could move away from also packaging GStreamer, which our old QtMultimedia audio system depended on...)

IIRC MLT is an optional CMake dependency, so it should be possible to build Krita without MLT as a workaround, at the cost of losing animation audio support...