Bug 378206 - Crash when moving key-frames and some frames land outside layers visible in timeline
Summary: Crash when moving key-frames and some frames land outside layers visible in t...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 3.1.2
Platform: unspecified All
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 376594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-28 15:33 UTC by SirPigeonz
Modified: 2017-11-21 12:00 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
I attach crash log (13.85 KB, text/plain)
2017-04-11 09:11 UTC, SirPigeonz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SirPigeonz 2017-03-28 15:33:35 UTC
How to reproduce:
- Open Animation View
- Add 3 layers
- Make those 3 layers visible in timeline
- Create key frames on first two frames
- Select all 2nd key-frames on all layers
- Move them in a way to transpose 2nd frame of 1st layer to lets say to 5th frame of 3rd layer

What happens
- 2 out of 3 frames that we are transposing don't have layer to be moved to
- Krita crashes

Expected behaviour
- Action is canceled
- Krita informs us with dialog that we tried to move frames outside layers
Comment 1 SirPigeonz 2017-04-11 09:11:39 UTC
Created attachment 104962 [details]
I attach crash log

I add crah log
Comment 2 Scott Petrovic 2017-08-30 22:44:49 UTC
I am not sure if my crash is the same as this one, but I also got some crash when trying to move around keyframes. It wasn't immediate, but took about 30 seconds for Krita to eventually crash. This is what my crash log says...

Surface Pro 4 and on Krita master.

Error occurred on Tuesday, August 29, 2017 at 21:25:56.

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

AddrPC           Params
00007FFFD99593E5 00007FFFD9ACA6A0 000000001FD4A1D0 0000000068D3A608  libkritaimage.dll!getKeyframeChannel  [C:/dev/krita/libs/image/kis_base_node.cpp @ 350]
   348: KisKeyframeChannel * KisBaseNode::getKeyframeChannel(const QString &id) const
   349: {
>  350:     QMap<QString, KisKeyframeChannel*>::const_iterator i = m_d->keyframeChannels.constFind(id);
   351:     if (i == m_d->keyframeChannels.constEnd()) {
   352:         return 0;
00007FFFB210CCF5 000000004A2F9960 000000005D7BFD40 000000004A2F9960  kritaanimationdocker.dll!_M_invoke  [C:/dev/krita/plugins/dockers/animation/kis_animation_utils.cpp @ 124]
   122:                     KisNodeSP node = item.node;
   123: 
>  124:                     KisKeyframeChannel *channel = node->getKeyframeChannel(item.channel);
   125: 
   126:                     if (!channel) continue;
00007FF80CEB78D6 0000000022670670 000000001FD4A1D0 000000001FD4A1C0  libkritacommand.dll!populateChildCommands  [C:/mingw/lib/gcc/x86_64-w64-mingw32/7.1.0/include/c++/bits/std_function.h @ 706]
   704:       if (_M_empty())
   705: __throw_bad_function_call();
>  706:       return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
   707:     }
   708: 
00007FF80CEB709B 0000000000000000 000000001FD4A1D0 0000000000000001  libkritacommand.dll!redo  [C:/dev/krita/libs/command/kis_command_utils.cpp @ 36]
    34:             m_firstRedo = false;
    35: 
>   36:             populateChildCommands();
    37:         }
    38: 
00007FFFD999677F 000000001FD4A1C0 0000000068B10515 000000004A3E4330  libkritaimage.dll!doStrokeCallback  [C:/dev/krita/libs/image/kis_stroke_strategy_undo_command_based.cpp @ 73]
    71:         command->undo();
    72:     } else {
>   73:         command->redo();
    74:     }
    75: }
00007FFFD9BD4727 000000001DF01F50 000000006FD0727C 0000000000000010  libkritaimage.dll!non-virtual thunk to KisUpdateJobItem::run()
0000000068899A94 000000004A2F9990 0000000045CCFF60 0000000018C82330  Qt5Core.dll!QThreadPool::~QThreadPool
000000006889B849 000000000D243530 0000000000000000 0000000000000000  Qt5Core.dll!QThread::setTerminationEnabled
00007FF8434BB2BA 00007FF843510670 0000000018C82330 0000000000000000  msvcrt.dll!_beginthreadex
00007FF8434BB38C 0000000000000000 0000000000000000 0000000000000000  msvcrt.dll!_endthreadex
00007FF843E88364 0000000000000000 0000000000000000 0000000000000000  KERNEL32.DLL!BaseThreadInitThunk
00007FF845F570D1 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!RtlUserThreadStart

krita.exe
ntdll.dll   	6.2.14393.1378
KERNEL32.DLL	6.2.14393.1198
KERNELBASE.dll	6.2.14393.1378
msvcrt.dll  	7.0.14393.0
libkritaui.dll
libkritawidgetutils.dll
Qt5Core.dll 	5.6.1.0
libKF5I18n.dll
Qt5Gui.dll  	5.6.1.0
Qt5Widgets.dll	5.6.1.0
ADVAPI32.dll	6.2.14393.0
sechost.dll 	6.2.14393.0
RPCRT4.dll  	6.2.14393.82
ole32.dll   	6.2.14393.1378
combase.dll 	6.2.14393.1378
ucrtbase.dll	6.2.14393.0
bcryptPrimitives.dll	6.2.14393.0
GDI32.dll   	6.2.14393.206
gdi32full.dll	6.2.14393.1358
USER32.dll  	6.2.14393.576
win32u.dll  	6.2.14393.51
SHELL32.dll 	6.2.14393.1480
cfgmgr32.dll	6.2.14393.0
windows.storage.dll	6.2.14393.1378
powrprof.dll	6.2.14393.0
shlwapi.dll 	6.2.14393.0
kernel.appcore.dll	6.2.14393.0
shcore.dll  	6.2.14393.953
profapi.dll 	6.2.14393.0
WS2_32.dll  	6.2.14393.206
libgcc_s_seh-1.dll
libintl.DLL 	0.18.0.0
libkritaglobal.dll
libkritaodf.dll
libkritaplugin.dll
libKF5ConfigCore.dll
libstdc++-6.dll
libKF5ConfigGui.dll
libKF5CoreAddons.dll
libKF5GuiAddons.dll
libKF5ItemViews.dll
libKF5WidgetsAddons.dll
libKF5WindowSystem.dll
Qt5PrintSupport.dll	5.6.1.0
Qt5Xml.dll  	5.6.1.0
MPR.dll     	6.2.14393.0
libkritacolor.dll
libkritacommand.dll
comdlg32.dll	6.2.14393.479
libkritaflake.dll
libkritaimage.dll
libkritaimpex.dll
libkritalibbrush.dll
libkritapigment.dll
libkritapsd.dll
libkritastore.dll
libkritaversion.dll
libkritawidgets.dll
libexiv2.dll
libKF5Completion.dll
Qt5Multimedia.dll	5.6.1.0
Qt5Network.dll	5.6.1.0
libHalf.dll
PSAPI.DLL   	6.2.14393.0
libpng16.dll
libwinpthread-1.dll	1.0.0.0
OPENGL32.dll	6.2.14393.0
iconv.dll
NETAPI32.dll	6.2.14393.0
USERENV.dll 	6.2.14393.0
WINSPOOL.DRV	6.2.14393.1198
COMCTL32.dll	5.82.14393.447
Qt5Svg.dll  	5.6.1.0
Qt5Concurrent.dll	5.6.1.0
libfftw3-3.dll
libKF5Archive.dll
libexpat.dll
libz.dll    	1.2.8.0
GLU32.dll   	6.2.14393.0
DDRAW.dll   	6.2.14393.953
DNSAPI.dll  	6.2.14393.953
NSI.dll     	6.2.14393.0
IPHLPAPI.DLL	6.2.14393.953
bcrypt.dll  	6.2.14393.576
NETUTILS.DLL	6.2.14393.0
DCIMAN32.dll	6.2.14393.0
LOGONCLI.DLL	6.2.14393.0
SAMCLI.DLL  	6.2.14393.0
IMM32.DLL   	6.2.14393.0
qwindows.dll	5.6.1.0
OLEAUT32.dll	6.2.14393.1378
msvcp_win.dll	6.2.14393.0
WINMM.dll   	6.2.14393.0
WINMMBASE.dll	6.2.14393.0
uxtheme.dll 	6.2.14393.0
tiptsf.dll  	6.2.14393.206
dwmapi.dll  	6.2.14393.206
ig9icd64.dll	21.20.16.4627
WTSAPI32.dll	6.2.14393.0
igc64.dll   	21.20.16.4627
kimg_kra.dll
kimg_ora.dll
kimg_pcx.dll
kimg_pic.dll
kimg_psd.dll
kimg_ras.dll
kimg_rgb.dll
kimg_tga.dll
kimg_xcf.dll
qdds.dll    	5.6.1.0
qgif.dll    	5.6.1.0
qicns.dll   	5.6.1.0
qico.dll    	5.6.1.0
qjpeg.dll   	5.6.1.0
qsvg.dll    	5.6.1.0
qtiff.dll   	5.6.1.0
qwbmp.dll   	5.6.1.0
qwebp.dll   	5.6.1.0
MSCTF.dll   	6.2.14393.953
clbcatq.dll 	2001.12.10941.16384
dataexchange.dll	6.2.14393.206
d3d11.dll   	6.2.14393.953
dcomp.dll   	6.2.14393.1378
dxgi.dll    	6.2.14393.953
twinapi.appcore.dll	6.2.14393.1378
exchndl.dll 	0.8.1.0
mgwhelp.dll 	0.8.1.0
VERSION.dll 	6.2.14393.0
dbghelp.dll 	6.3.9600.17298
wintab32.dll	1.0.0.20
MSVCP100.dll	10.0.40219.325
DHid.dll    	1.0.0.20
MSVCR100.dll	10.0.40219.325
HID.DLL     	6.2.14393.0
uiautomationcore.dll	7.2.14393.479
sxs.dll     	6.2.14393.0
OLEACC.dll  	7.2.14393.953
twinapi.dll 	6.2.14393.953
kritalcmsengine.dll
liblcms2.dll
krita_colorspaces_extensions.dll
krita_shape_image.dll
krita_shape_text.dll
libkritatextlayout.dll
libkritatext.dll
krita_flaketools.dll
krita_karbontools.dll
krita_tool_basicflakes.dll
libkritabasicflakes.dll
krita_shape_vector.dll
libkritavectorimage.dll
krita_shape_artistictext.dll
krita_shape_paths.dll
krita_filtereffects.dll
kritachalkpaintop.dll
libkritalibpaintop.dll
kritacolorsmudgepaintop.dll
kritacurvepaintop.dll
kritadefaultpaintops.dll
kritadeformpaintop.dll
kritadynapaintop.dll
kritaexperimentpaintop.dll
kritafilterop.dll
kritagridpaintop.dll
kritahairypaintop.dll
kritahatchingpaintop.dll
kritaparticlepaintop.dll
kritaroundmarkerpaintop.dll
kritasketchpaintop.dll
kritaspraypaintop.dll
kritatangentnormalpaintop.dll
kritablurfilter.dll
kritacolorsfilters.dll
kritaconvolutionfilters.dll
kritadodgeburn.dll
kritaembossfilter.dll
kritaexample.dll
kritaextensioncolorsfilters.dll
kritafastcolortransferfilter.dll
kritagradientmap.dll
kritahalftone.dll
kritaimageenhancement.dll
kritaindexcolors.dll
kritalevelfilter.dll
kritanoisefilter.dll
kritanormalize.dll
kritaoilpaintfilter.dll
kritaphongbumpmap.dll
kritapixelizefilter.dll
kritaposterize.dll
kritaraindropsfilter.dll
kritarandompickfilter.dll
kritaroundcornersfilter.dll
kritasmalltilesfilter.dll
kritasobelfilter.dll
kritathreshold.dll
kritaunsharpfilter.dll
kritawavefilter.dll
kritacolorgenerator.dll
kritapatterngenerator.dll
kritadefaulttools.dll
libboost_system-mgw71-mt-1_61.dll
kritarulerassistanttool.dll
kritaselectiontools.dll
kritatoolSmartPatch.dll
kritatoolcrop.dll
kritatooldyna.dll
kritatoollazybrush.dll
kritatoolpolygon.dll
kritatoolpolyline.dll
kritatooltext.dll
kritatooltransform.dll
kritaanimationdocker.dll
krita_docker_defaults.dll
kritaarrangedocker.dll
kritaartisticcolorselector.dll
kritachanneldocker.dll
kritacolorselectorng.dll
qsvgicon.dll	5.6.1.0
kritacolorslider.dll
kritacompositiondocker.dll
kritadefaultdockers.dll
kritadigitalmixer.dll
kritagriddocker.dll
kritahistogramdocker.dll
kritahistorydocker.dll
kritaimagedocker.dll
kritalutdocker.dll
libOpenColorIO.dll
kritaoverviewdocker.dll
kritapalettedocker.dll
kritapatterndocker.dll
kritapresetdocker.dll
kritapresethistory.dll
kritasmallcolorselector.dll
kritaspecificcolorselector.dll
kritatasksetdocker.dll
edputil.dll 	6.2.14393.1358
kritaanimationrenderer.dll
kritabigbrother.dll
kritabuginfo.dll
kritaclonesarray.dll
kritacolorrange.dll
kritacolorspaceconversion.dll
kritahistogram.dll
kritaimagesize.dll
kritaimagesplit.dll
kritalayergroupswitcher.dll
kritalayersplit.dll
kritametadataeditor.dll
kritamodifyselection.dll
kritaoffsetimage.dll
kritaqmic.dll
kritaresourcemanager.dll
kritarotateimage.dll
kritaseparatechannels.dll
kritashearimage.dll
kritawaveletdecompose.dll
Ninput.dll  	6.2.14393.0
comctl32.DLL	6.10.14393.953
kritakraimport.dll
libkritalibkra.dll
SspiCli.dll 	6.2.14393.576
SAMLIB.dll  	6.2.14393.82
kritakraexport.dll
WindowsCodecs.dll	6.2.14393.1378
WININET.dll 	11.0.14393.1480
iertutil.dll	11.0.14393.1480
ondemandconnroutehelper.dll	6.2.14393.351
winhttp.dll 	6.2.14393.953
mswsock.dll 	6.2.14393.0
WINNSI.DLL  	6.2.14393.0
urlmon.dll  	11.0.14393.1480
rasadhlp.dll	6.2.14393.0
fwpuclnt.dll	6.2.14393.0
Cabinet.dll 	5.0.1.1

Windows 6.2.9200
DrMingw 0.8.1
Comment 3 Halla Rempt 2017-11-20 15:33:46 UTC
I will confirm this bug. The issue is probably that the keyframe channels are stored as pointers in a map; the channel that gets stored is an object held in a QScopedPointer, so as soon as that goes out of scope, the references in the 

QMap<QString, QPointer<KisKeyframeChannel>> keyframeChannels;

map become dangling.

All use of keyframechannels should be rewritten to use shared pointers.
Comment 4 joupent 2017-11-20 17:26:54 UTC
The bug can be reliably reproduced in 3.1.2, but not in git master. After testing appimages, it appears the bug was fixed between 3.1.2 and 3.1.3 (likely by commit b0aa6b3).
Comment 5 joupent 2017-11-21 12:00:33 UTC
*** Bug 376594 has been marked as a duplicate of this bug. ***