Bug 448546 - Whenever I try to add a new blank frame, the program crashes. :(
Summary: Whenever I try to add a new blank frame, the program crashes. :(
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 5.0.2
Platform: Microsoft Windows Unspecified
: NOR crash
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-15 19:01 UTC by kmelisargzh
Modified: 2022-01-19 23:56 UTC (History)
2 users (show)

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


Attachments
Code Krita told me to paste (254.90 KB, text/plain)
2022-01-15 19:01 UTC, kmelisargzh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kmelisargzh 2022-01-15 19:01:10 UTC
Created attachment 145507 [details]
Code Krita told me to paste

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. 
2. 
3. 

OBSERVED RESULT
Exactly what the summary says: whenever I click on "Create blank frame" the program just closes itself, without saving anything.


EXPECTED RESULT
It doesent crash and just creates a frame.


SOFTWARE/OS VERSIONS
Windows: 11
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 wolthera 2022-01-15 20:11:53 UTC
Thanks!

hm.... There's several crashes in that file, but this one is the most common:


krita.exe caused an Access Violation at location 00007FFAFFB217F0 in module libkritaimage.dll Reading from location 0000000000000020.

AddrPC           Params
00007FFAFFB217F0 0000000056D3BF55 000000003CE5A270 000000003D88FB40  libkritaimage.dll!0x2317f0 KisScalarKeyframe::value+0x0
00007FFAFF92C787 00000000202F7CA0 000000006FC621FB 01D80A3CA6484DFF  libkritaimage.dll!0x3c787 KisAnimatedOpacityProperty::set+0x337
00007FFAF8FA6871 0000000000000000 00007FFAFFA2E0D8 000000004681C8F0  kritaanimationdocker.dll!0x6871 std::_Function_handler<KUndo2Command* (), KisAnimUtils::createKeyframeCommand(KisSharedPtr<KisImage>, KisSharedPtr<KisNode>, QString const&, int, bool, KUndo2Command*)::{lambda()#1}>::_M_invoke+0x211
00007FFB7E9889F6 000000004681C8F0 000000004681C8F0 0000000037DDED80  libkritacommand.dll!0x89f6 KisCommandUtils::LambdaCommand::populateChildCommands+0x16
00007FFB7E9884CB 0000000029C91340 00007FFAFFA41B45 0000000000000000  libkritacommand.dll!0x84cb KisCommandUtils::AggregateCommand::redo+0x1b
00007FFAFFA2EB96 000000033CE5A370 00007FFAFEBEA3BD 0000000000000100  libkritaimage.dll!0x13eb96 KisStrokeStrategyUndoCommandBased::doStrokeCallback+0x76
00007FFAFFC39E70 0000000000000010 000000003CE5A370 000000004673C360  libkritaimage.dll!0x349e70 KisUpdateJobItem::run+0x90
00007FFAFEA18A90 0000000029C91F70 000000004673C300 0000000000000000  Qt5Core.dll!0x28a90 QThreadPool::tryStart+0x520
00007FFAFEA11AAF 0000000000000000 0000000000000000 0000000000000000  Qt5Core.dll!0x21aaf QThread::qt_metacall+0x69f
00007FFB94B154E0 0000000000000000 0000000000000000 0000000000000000  KERNEL32.DLL!0x154e0 BaseThreadInitThunk+0x10
00007FFB9524485B 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!0x485b RtlUserThreadStart+0x2b

This one is a crash because Krita is trying to make an opacity keyframe, but failing? This one happens 5 times. Looking at it, there's a shared pointer being checked there (called m_channel->keyframeAt<KisScalarKeyframe>(time)), and that might actually not exist, which means the program gets confused and crashes.

The others are...

1x a crash with the layer properties changing
1x OpenGL crashing.
1x a crash when generating the frame-cache (that's what is used for playback)

My instinct is to check whether the pointer exists before we try to access it, but maybe Eoin has a more robust idea. Assigning it to him.
Comment 2 Eoin O'Neill 2022-01-18 21:28:59 UTC
Hi there kmelisargzh, 

So I've poked around on my Windows build and cannot reproduce this issue on my machine. Could you do the following for me?

1) Please try uninstalling and installing Krita 5.0.2 again -- I'm mostly interested to know whether or not a fresh install will change the results here. If this was an upgrade, it could be that some of the old animation-related libraries stayed installed on your system which is causing an interference.

2) If a fresh installation does not solve your problem, please provide me with details regarding your system hardware and configuration (`Display > Canvas Acceleration` and  `Performance > Animation Cache` settings page details, in particular, would be nice to know here.)

Sorry for the inconvenience,
Eoin.
Comment 3 Alvin Wong 2022-01-19 10:00:40 UTC
There is one safe assert in the log:

    SAFE ASSERT (krita): "m_d->requestedFrame == frame" in file C:\Packaging\workspace\Krita_Release_Windows64_Build\krita\libs\ui\KisAsyncAnimationRendererBase.cpp, line 133

https://invent.kde.org/graphics/krita/-/blob/v5.0.2/libs/ui/KisAsyncAnimationRendererBase.cpp#L133
Comment 4 kmelisargzh 2022-01-19 17:12:08 UTC
(In reply to Eoin O'Neill from comment #2)
> Hi there kmelisargzh, 
> 
> So I've poked around on my Windows build and cannot reproduce this issue on
> my machine. Could you do the following for me?
> 
> 1) Please try uninstalling and installing Krita 5.0.2 again -- I'm mostly
> interested to know whether or not a fresh install will change the results
> here. If this was an upgrade, it could be that some of the old
> animation-related libraries stayed installed on your system which is causing
> an interference.
> 
> 2) If a fresh installation does not solve your problem, please provide me
> with details regarding your system hardware and configuration (`Display >
> Canvas Acceleration` and  `Performance > Animation Cache` settings page
> details, in particular, would be nice to know here.)
> 
> Sorry for the inconvenience,
> Eoin.

First of all, sorry for the late reply. Second of all, I think I figured it out! :D I looked at the Performance and just increased the memory limit (i dont know what its called in english, sorry) and now it works again! Thank you so much, and sorry for bothering you! Have a nice week.
Comment 5 Eoin O'Neill 2022-01-19 23:56:48 UTC
kmelisargzh,

That's good to hear. :) Maybe we can do more to give more feedback for when crashes occur due to certain settings. I'll look into that at some point as well. 

Hope you have a good week,
Eoin