When loading a file that contains a layer with a warp type transform mask applied Krita crashes. git 059cb66 Reproducible: Always Steps to Reproduce: 1. Apply transform mask to layer 2. Set type to "warp" and make some alterations 3. Save and reload file Actual Results: Crash Expected Results: Loaded the file
Created attachment 92617 [details] Sample files with transform mask applied
Hi Marcus, I can confirm that with the 003.kra file from your zipfile Krita crashes: Thread 7 (Thread 0x7f2f3d579700 (LWP 19375)): [KCrash Handler] #5 0x00007f2f691bf187 in raise () at /lib64/libc.so.6 #6 0x00007f2f691c0538 in abort () at /lib64/libc.so.6 #7 0x00007f2f6a4ba2b4 in qt_message_output(QtMsgType, char const*) () at /usr/lib64/libQtCore.so.4 #8 0x00007f2f6a4ba439 in () at /usr/lib64/libQtCore.so.4 #9 0x00007f2f6a4bac44 in qFatal(char const*, ...) () at /usr/lib64/libQtCore.so.4 #10 0x00007f2f6a4bac8a in () at /usr/lib64/libQtCore.so.4 #11 0x00007f2f70fb52d8 in KisSharedPtr<KisPaintDevice>::operator->() (this=this@entry=0x7f2f3d578410) at /home/boud/kde/src/2.9/krita/image/kis_shared_ptr.h:184 #12 0x00007f2f70fb7548 in copyAreaOptimizedImpl<false>(QPoint const&, KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) (dstPt=..., src=..., dst=..., srcRect=...) at /home/boud/kde/src/2.9/krita/image/kis_painter.cc:197 #13 0x00007f2f70fb3e4c in KisPainter::copyAreaOptimized(QPoint const&, KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) (dstPt=..., src=..., dst=..., srcRect=...) at /home/boud/kde/src/2.9/krita/image/kis_painter.cc:221 #14 0x00007f2f710a6f4c in KisTransformMask::decorateRect(KisSharedPtr<KisPaintDevice>&, KisSharedPtr<KisPaintDevice>&, QRect const&, KisNode::PositionToFilthy) const (this=0x4ba8be0, src=..., dst=..., rc=..., maskPos=KisNode::N_ABOVE_FILTHY) at /home/boud/kde/src/2.9/krita/image/kis_transform_mask.cpp:258 #15 0x00007f2f71120cc2 in KisMask::apply(KisSharedPtr<KisPaintDevice>, QRect const&, QRect const&, KisNode::PositionToFilthy) const (this=0x4ba8be0, projection=..., applyRect=..., needRect=..., maskPos=maskPos@entry=KisNode::N_ABOVE_FILTHY) at /home/boud/kde/src/2.9/krita/image/kis_mask.cc:257 #16 0x00007f2f7110a4d3 in KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (this=this@entry=0x4b9a5d0, source=..., destination=..., requestedRect=..., filthyNode=..., lastNode=...) at /home/boud/kde/src/2.9/krita/image/kis_layer.cc:569 #17 0x00007f2f7110b86f in KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (this=0x4b9a5d0, rect=..., filthyNode=...) at /home/boud/kde/src/2.9/krita/image/kis_layer.cc:621 #18 0x00007f2f71111b51 in KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (this=0x42fd5a0, rect=..., filthyNode=...) at /home/boud/kde/src/2.9/krita/image/kis_layer_projection_plane.cpp:47 #19 0x00007f2f710c3f14 in KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (this=this@entry=0x4bace20, walker=..., notifyClones=notifyClones@entry=true) at /home/boud/kde/src/2.9/krita/image/kis_async_merger.cpp:239 #20 0x00007f2f70f72e35 in KisUpdateJobItem::run() (this=0x4bacde0) at /home/boud/kde/build/2.9/krita/image/../../../../src/2.9/krita/image/kis_update_job_item.h:77 #21 0x00007f2f70f72e35 in KisUpdateJobItem::run() (this=0x4bacde0) at /home/boud/kde/build/2.9/krita/image/../../../../src/2.9/krita/image/kis_update_job_item.h:58 #22 0x00007f2f6a4b86ae in () at /usr/lib64/libQtCore.so.4 #23 0x00007f2f6a4c479f in () at /usr/lib64/libQtCore.so.4 #24 0x00007f2f7053d754 in () at /usr/X11R6/lib64/libGL.so.1 #25 0x00007f2f6a22e0a4 in start_thread () at /lib64/libpthread.so.0 #26 0x00007f2f6926f06d in clone () at /lib64/libc.so.6 Thread 6 (Thread 0x7f2f25a28700 (LWP 19376)): #0 0x00007f2f6a232408 in pthread_cond_timedwait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f2f6a4c4c64 in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQtCore.so.4 #2 0x00007f2f6a4b87ba in () at /usr/lib64/libQtCore.so.4 #3 0x00007f2f6a4c479f in () at /usr/lib64/libQtCore.so.4 #4 0x00007f2f7053d754 in () at /usr/X11R6/lib64/libGL.so.1 #5 0x00007f2f6a22e0a4 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f2f6926f06d in clone () at /lib64/libc.so.6 Thread 5 (Thread 0x7f2f25227700 (LWP 19377)): #0 0x00007f2f6a232408 in pthread_cond_timedwait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f2f6a4c4c64 in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQtCore.so.4 #2 0x00007f2f6a4b87ba in () at /usr/lib64/libQtCore.so.4 #3 0x00007f2f6a4c479f in () at /usr/lib64/libQtCore.so.4 #4 0x00007f2f7053d754 in () at /usr/X11R6/lib64/libGL.so.1 #5 0x00007f2f6a22e0a4 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f2f6926f06d in clone () at /lib64/libc.so.6 Thread 4 (Thread 0x7f2f24a26700 (LWP 19378)): #0 0x00007f2f6a232408 in pthread_cond_timedwait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f2f6a4c4c64 in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQtCore.so.4 #2 0x00007f2f6a4b87ba in () at /usr/lib64/libQtCore.so.4 #3 0x00007f2f6a4c479f in () at /usr/lib64/libQtCore.so.4 #4 0x00007f2f7053d754 in () at /usr/X11R6/lib64/libGL.so.1 #5 0x00007f2f6a22e0a4 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f2f6926f06d in clone () at /lib64/libc.so.6 Thread 3 (Thread 0x7f2f17fff700 (LWP 19379)): #0 0x00007f2f6a232408 in pthread_cond_timedwait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f2f6a4c4c64 in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQtCore.so.4 #2 0x00007f2f6a4b87ba in () at /usr/lib64/libQtCore.so.4 #3 0x00007f2f6a4c479f in () at /usr/lib64/libQtCore.so.4 #4 0x00007f2f7053d754 in () at /usr/X11R6/lib64/libGL.so.1 #5 0x00007f2f6a22e0a4 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f2f6926f06d in clone () at /lib64/libc.so.6 Thread 2 (Thread 0x7f2f177fe700 (LWP 19380)): #0 0x00007f2f6a232408 in pthread_cond_timedwait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f2f6a4c4c64 in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQtCore.so.4 #2 0x00007f2f6a4b87ba in () at /usr/lib64/libQtCore.so.4 #3 0x00007f2f6a4c479f in () at /usr/lib64/libQtCore.so.4 #4 0x00007f2f7053d754 in () at /usr/X11R6/lib64/libGL.so.1 #5 0x00007f2f6a22e0a4 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f2f6926f06d in clone () at /lib64/libc.so.6 Thread 1 (Thread 0x7f2f725c77c0 (LWP 19358)): #0 0x00007f2f6a23205f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #1 0x00007f2f6a4c4c86 in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQtCore.so.4 #2 0x00007f2f6a4b7912 in () at /usr/lib64/libQtCore.so.4 #3 0x00007f2f6a4b8dd2 in QThreadPool::waitForDone() () at /usr/lib64/libQtCore.so.4 #4 0x00007f2f710d0079 in KisUpdaterContext::waitForDone() (this=<optimized out>) at /home/boud/kde/src/2.9/krita/image/kis_updater_context.cpp:173 #5 0x00007f2f710e312d in KisUpdateScheduler::waitForDone() (this=0x4bac3e0) at /home/boud/kde/src/2.9/krita/image/kis_update_scheduler.cpp:249 #6 0x00007f2f710f56df in KisImage::waitForDone() (this=this@entry=0x4b99560) at /home/boud/kde/src/2.9/krita/image/kis_image.cc:1286 #7 0x00007f2f710f65ab in KisImage::initialRefreshGraph() (this=0x4b99560) at /home/boud/kde/src/2.9/krita/image/kis_image.cc:1415 #8 0x00007f2f71e6e2d9 in KisDocument::completeLoading(KoStore*) (this=0x4979ad0, store=<optimized out>) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:1866 #9 0x00007f2f71e771c9 in KisDocument::loadNativeFormatFromStoreInternal(KoStore*) (this=this@entry=0x4979ad0, store=store@entry=0x4b77b40) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:1698 #10 0x00007f2f71e77706 in KisDocument::loadNativeFormat(QString const&) (this=0x4979ad0, file_=...) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:1627 #11 0x00007f2f71e753e1 in KisDocument::openFile() (this=0x4979ad0) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:1416 #12 0x00007f2f71e7beda in KisDocument::Private::openLocalFile() (this=0x47b0380) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:380 #13 0x00007f2f71e7beda in KisDocument::Private::openLocalFile() (this=0x47b0380) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:402 #14 0x00007f2f71e79494 in KisDocument::openUrlInternal(KUrl const&) (this=this@entry=0x4979ad0, url=...) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:2425 #15 0x00007f2f71e796b8 in KisDocument::openUrl(KUrl const&) (this=0x4979ad0, _url=...) at /home/boud/kde/src/2.9/krita/ui/KisDocument.cpp:1232 #16 0x00007f2f71ea34db in KisMainWindow::openDocumentInternal(KUrl const&, KisDocument*) (this=this@entry=0x356f360, url=..., newdoc=0x4979ad0) at /home/boud/kde/src/2.9/krita/ui/KisMainWindow.cpp:680 #17 0x00007f2f71e61a8a in KisApplication::start() (this=this@entry=0x7ffe728736c0) at /home/boud/kde/src/2.9/krita/ui/KisApplication.cpp:401 #18 0x0000000000402a20 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/boud/kde/src/2.9/krita/main.cc:167
That was fast :D Thanks, Boudewijn.
Need to set it confirmed in that case...
Is this still reproduceable? All the files load for me in Krita 3.
Git commit 241ddd4ec56b58172e631596696c4ea369e52a05 by Dmitry Kazakov. Committed on 14/04/2016 at 14:47. Pushed by dkazakov into branch 'master'. Make transform mask return a change rect for the non-affine transoforms as well We have to use really rough approximations for calculating the change rect of cage, warp and liquify transformation. The main problem is that there is no explicit f(x) solution for most of them (except for warp). So we should be a bit tricky. M +1 -1 libs/image/kis_async_merger.cpp M +1 -1 libs/image/kis_base_rects_walker.h M +60 -0 libs/image/kis_cage_transform_worker.cpp M +3 -0 libs/image/kis_cage_transform_worker.h M +28 -0 libs/image/kis_liquify_transform_worker.cpp M +3 -0 libs/image/kis_liquify_transform_worker.h M +35 -20 libs/image/kis_transform_mask.cpp M +11 -0 libs/image/kis_transform_mask_params_interface.cpp M +6 -0 libs/image/kis_transform_mask_params_interface.h M +18 -0 libs/image/kis_warptransform_worker.cc M +4 -1 libs/image/kis_warptransform_worker.h M +96 -0 libs/image/krita_utils.cpp M +8 -0 libs/image/krita_utils.h M +57 -32 libs/image/tests/kis_warp_transform_worker_test.cpp M +2 -0 libs/image/tests/kis_warp_transform_worker_test.h M +10 -0 plugins/tools/tool_transform2/kis_transform_mask_adapter.cpp M +3 -0 plugins/tools/tool_transform2/kis_transform_mask_adapter.h M +66 -0 plugins/tools/tool_transform2/kis_transform_utils.cpp M +7 -0 plugins/tools/tool_transform2/kis_transform_utils.h http://commits.kde.org/krita/241ddd4ec56b58172e631596696c4ea369e52a05
(In reply to Dmitry Kazakov from comment #6) > Git commit 241ddd4ec56b58172e631596696c4ea369e52a05 by Dmitry Kazakov. > Committed on 14/04/2016 at 14:47. > Pushed by dkazakov into branch 'master'. > > Make transform mask return a change rect for the non-affine transoforms as > well You have two typos in the patch: QRect KisCageTransformWorker::approxChangeRect(const QRect &rc) { const int margin = 0.30; // <<<<<<<< .... return KisAlgebra2D::blowRect(resultRect | rc, margin); } and QRect KisLiquifyTransformWorker::approxChangeRect(const QRect &rc) { const int margin = 0.05; // <<<<<<<< .... return KisAlgebra2D::blowRect(resultRect | rc, margin); } In this cases int equals zero. It should be qreal.
Fixed in a053a73edf5f89eb94895962457d8ff743bef40c