Bug 499658 - Crash when closing a playing animation while more than 1 document tab is open
Summary: Crash when closing a playing animation while more than 1 document tab is open
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 5.2.9
Platform: NixOS Linux
: NOR crash
Target Milestone: ---
Assignee: Emmet O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-07 18:36 UTC by cromachina
Modified: 2025-03-14 00:35 UTC (History)
2 users (show)

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


Attachments
Crash callstack data and test KRA files (287.09 KB, application/zip)
2025-02-07 18:36 UTC, cromachina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cromachina 2025-02-07 18:36:52 UTC
Created attachment 178056 [details]
Crash callstack data and test KRA files

SUMMARY
If an animation is playing while two documents are open, and you close the active document, Krita will crash.
Attached are two of the same KRA documents to test with, along with the crash log from drkonqi.

STEPS TO REPRODUCE
1. Open two documents with animations.
2. Play one of the document's animation.
3. Click the close button on the document's tab.

OBSERVED RESULT
Crash.

EXPECTED RESULT
The document closes without issue.

SOFTWARE/OS VERSIONS
Operating System: NixOS 25.05
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.12 (64-bit)
Graphics Platform: X11
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX

ADDITIONAL INFORMATION
Crash location:
Thread 1 (Thread 0x7fc00812a8c0 (LWP 59728)):
[KCrash Handler]
#4  0x0000000000000000 in ?? ()
#5  0x00007fc00dd769aa in CanvasPlaybackEnvironment::restore() () from /nix/store/gkhgzaiqg0h8mx3v4yx0mzvplg8bdg1s-krita-unwrapped-5.2.9/lib/libkritaui.so.19
#6  0x00007fc00dd751cd in KisCanvasAnimationState::~KisCanvasAnimationState() () from /nix/store/gkhgzaiqg0h8mx3v4yx0mzvplg8bdg1s-krita-unwrapped-5.2.9/lib/libkritaui.so.19
Comment 1 Emmet O'Neill 2025-03-14 00:35:19 UTC
Git commit 33cb2b2fafed33368669b9b923371fad3f9aa513 by Emmet O'Neill.
Committed on 14/03/2025 at 00:31.
Pushed by emmetoneill into branch 'master'.

Fixed crash on closing secondary animated document during playback.

I think this crash had to do with the lifetime of the
frame cache being longer than that of the canvas animation state.
Manually clearly the canvas animation state fixes it.

M  +6    -0    libs/ui/canvas/kis_canvas2.cpp

https://invent.kde.org/graphics/krita/-/commit/33cb2b2fafed33368669b9b923371fad3f9aa513