Bug 395003 - Crash when Clone Layer with Transform Mask is merged with it's parent.
Summary: Crash when Clone Layer with Transform Mask is merged with it's parent.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 4.0.3
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-03 19:25 UTC by SirPigeonz
Modified: 2018-06-26 15:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
crashing test file (447.16 KB, application/x-krita)
2018-06-03 19:25 UTC, SirPigeonz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SirPigeonz 2018-06-03 19:25:18 UTC
Created attachment 113049 [details]
crashing test file

Attached test file. Just perform Merge on Group.

Crash occurs when we merge while having Clone Layer and it's Original in one Group and Clone layer has Transform Mask on it.
Comment 1 SirPigeonz 2018-06-03 19:26:47 UTC
Ah forgot one more thing.

Clone must be below it's Original for it to crash.
Comment 2 Antti Savolainen 2018-06-03 22:03:35 UTC
Easily reproducable https://youtu.be/xlDNFw0-SOk

Build Date & Platform:

    krita 4.1.0-pre-alpha (Built on 4.6.2018)
    Xubuntu 17.10
    Krita Lime https://launchpad.net/~kritalime/+archive/ubuntu/ppa

(gdb) bt
#0  0x00007ffff44f40bb in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff44f5f5d in __GI_abort () at abort.c:90
#2  0x00007ffff4ed1107 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff678c584 in kis_assert_common(char const*, char const*, int, bool, bool) (assertion=0x7ffff77d4cd4 "nodeColorSpace", file=0x7ffff77d4c60 "/home/managor/Sourcebuilding/krita/krita-testing-4.0.0/libs/ui/canvas/kis_display_color_converter.cpp", line=255, throwException=false, isIgnorable=false) at ./libs/global/kis_assert.cpp:90
#4  0x00007ffff678c89c in kis_assert_recoverable(char const*, char const*, int) (assertion=0x7ffff77d4cd4 "nodeColorSpace", file=0x7ffff77d4c60 "/home/managor/Sourcebuilding/krita/krita-testing-4.0.0/libs/ui/canvas/kis_display_color_converter.cpp", line=255)
    at ./libs/global/kis_assert.cpp:103
#5  0x00007ffff725e365 in KisDisplayColorConverter::Private::setCurrentNode(KisSharedPtr<KisNode>) (this=0x555560a61a80, node=...) at ./libs/ui/canvas/kis_display_color_converter.cpp:255
#6  0x00007ffff725e07b in KisDisplayColorConverter::Private::slotCanvasResourceChanged(int, QVariant const&) (this=0x555560a61a80, key=6005, v=...) at ./libs/ui/canvas/kis_display_color_converter.cpp:223
#7  0x00007ffff726047d in KisDisplayColorConverter::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x55556098c3a0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffffcdc0)
    at ./obj-x86_64-linux-gnu/libs/ui/kritaui_autogen/include/moc_kis_display_color_converter.cpp:91
#8  0x00007ffff50f28e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff16feaa3 in KoCanvasResourceManager::canvasResourceChanged(int, QVariant const&) (this=0x55555eb02a18, _t1=6005, _t2=...) at ./obj-x86_64-linux-gnu/libs/flake/kritaflake_autogen/EWIEGA46WW/moc_KoCanvasResourceManager.cpp:154
#10 0x00007ffff152ec14 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<int, QVariant const&>, void, void (KoCanvasResourceManager::*)(int, QVariant const&)>::call(void (KoCanvasResourceManager::*)(int, QVariant const&), KoCanvasResourceManager*, void**) (f=(void (KoCanvasResourceManager::*)(KoCanvasResourceManager * const, int, const QVariant &)) 0x7ffff16fea3a <KoCanvasResourceManager::canvasResourceChanged(int, QVariant const&)>, o=0x55555eb02a18, arg=0x7fffffffcfd0)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:136
#11 0x00007ffff152eb7f in QtPrivate::FunctionPointer<void (KoCanvasResourceManager::*)(int, QVariant const&)>::call<QtPrivate::List<int, QVariant const&>, void>(void (KoCanvasResourceManager::*)(int, QVariant const&), KoCanvasResourceManager*, void**) (f=
    (void (KoCanvasResourceManager::*)(KoCanvasResourceManager * const, int, const QVariant &)) 0x7ffff16fea3a <KoCanvasResourceManager::canvasResourceChanged(int, QVariant const&)>, o=0x55555eb02a18, arg=0x7fffffffcfd0)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:169
#12 0x00007ffff152eae9 in QtPrivate::QSlotObject<void (KoCanvasResourceManager::*)(int, QVariant const&), QtPrivate::List<int, QVariant const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x5555560f39c0, r=0x55555eb02a18, a=0x7fffffffcfd0, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
#13 0x00007ffff50f29ff in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff16ff77d in KoResourceManager::resourceChanged(int, QVariant const&) (this=0x55555ead6170, _t1=6005, _t2=...) at ./obj-x86_64-linux-gnu/libs/flake/kritaflake_autogen/EWIEGA46WW/moc_KoResourceManager_p.cpp:138
#15 0x00007ffff15281b8 in KoResourceManager::notifyResourceChanged(int, QVariant const&) (this=0x55555ead6170, key=6005, value=...) at ./libs/flake/KoResourceManager_p.cpp:74
#16 0x00007ffff15280b6 in KoResourceManager::setResource(int, QVariant const&) (this=0x55555ead6170, key=6005, value=...) at ./libs/flake/KoResourceManager_p.cpp:67
#17 0x00007ffff152de5f in KoCanvasResourceManager::setResource(int, QVariant const&) (this=0x55555eb02a18, key=6005, value=...) at ./libs/flake/KoCanvasResourceManager.cpp:58
#18 0x00007ffff7374dd7 in KisCanvasResourceProvider::slotNodeActivated(KisSharedPtr<KisNode>) (this=0x55555eb029e0, node=...) at ./libs/ui/kis_canvas_resource_provider.cpp:248
#19 0x00007ffff77b045d in KisCanvasResourceProvider::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x55555eb029e0, _c=QMetaObject::InvokeMetaMethod, _id=20, _a=0x7fffffffd3b0)
    at ./obj-x86_64-linux-gnu/libs/ui/kritaui_autogen/EWIEGA46WW/moc_kis_canvas_resource_provider.cpp:206
#20 0x00007ffff50f28e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff77b689a in KisNodeManager::sigNodeActivated(KisSharedPtr<KisNode>) (this=0x55555eb028c8, _t1=...) at ./obj-x86_64-linux-gnu/libs/ui/kritaui_autogen/EWIEGA46WW/moc_kis_node_manager.cpp:447
#22 0x00007ffff73df514 in KisNodeManager::slotSomethingActivatedNodeImpl(KisSharedPtr<KisNode>) (this=0x55555eb028c8, node=...) at ./libs/ui/kis_node_manager.cpp:612
#23 0x00007ffff73df7ac in KisNodeManager::slotNonUiActivatedNode(KisSharedPtr<KisNode>) (this=0x55555eb028c8, node=...) at ./libs/ui/kis_node_manager.cpp:626
#24 0x00007ffff77b5b72 in KisNodeManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x55555eb028c8, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffd650)
    at ./obj-x86_64-linux-gnu/libs/ui/kritaui_autogen/EWIEGA46WW/moc_kis_node_manager.cpp:315
#25 0x00007ffff50f28e5 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007ffff77ac288 in KisDummiesFacadeBase::sigActivateNode(KisSharedPtr<KisNode>) (this=0x55556094d040, _t1=...) at ./obj-x86_64-linux-gnu/libs/ui/kritaui_autogen/QUY67KCZCL/moc_kis_dummies_facade_base.cpp:301
#27 0x00007ffff73424b8 in KisDummiesFacadeBase::slotNodeActivationRequested(KisSharedPtr<KisNode>) (this=0x55556094d040, node=...) at ./libs/ui/flake/kis_dummies_facade_base.cpp:108
#28 0x00007ffff77ab874 in KisDummiesFacadeBase::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x55556094d040, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7fff9080ef00)
    at ./obj-x86_64-linux-gnu/libs/ui/kritaui_autogen/QUY67KCZCL/moc_kis_dummies_facade_base.cpp:144
#29 0x00007ffff50f3452 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007ffff5e3e46c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007ffff5e45d34 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007ffff76aa4f5 in KisApplication::notify(QObject*, QEvent*) (this=0x7fffffffde40, receiver=0x55556094d040, event=0x7fff9080ed70) at ./libs/ui/KisApplication.cpp:652
#33 0x00007ffff50c3de8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007ffff50c655d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007ffff511ce53 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#36 0x00007fffec78ffb7 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007fffec7901f0 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007fffec79027c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007ffff511c47f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#40 0x00007ffff50c1e3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00007ffff50cada4 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#42 0x0000555555849493 in main(int, char**) (argc=1, argv=0x7fffffffdfc8) at ./krita/main.cc:361
Comment 3 Halla Rempt 2018-06-05 07:53:26 UTC
I can confirm too, and thanks for providing the test file, that makes life a lot easier!
Comment 4 Dmitry Kazakov 2018-06-20 18:28:00 UTC
Git commit 026e857c0c6899e2bab04727ef30eb82c9cb6c68 by Dmitry Kazakov.
Committed on 20/06/2018 at 18:27.
Pushed by dkazakov into branch 'master'.

Fix assert when trying to merge down a group with a transform mask

We should be very careful about passing node pointers in queued signals.
Sometimes it may happen that the signal is delivered *after* the node has
been removed from the layers graph. If it is possible and we should avoid
that, e.g. activating this node, we should check node's graph listener's
pointer.

M  +6    -2    libs/ui/canvas/kis_display_color_converter.cpp
M  +2    -0    libs/ui/flake/kis_dummies_facade_base.cpp
M  +9    -0    libs/ui/kis_node_manager.cpp

https://commits.kde.org/krita/026e857c0c6899e2bab04727ef30eb82c9cb6c68
Comment 5 Halla Rempt 2018-06-25 07:58:30 UTC
Git commit 223f0d2d0bc13e8378ad48ecf414291ac977624c by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 25/06/2018 at 07:57.
Pushed by rempt into branch 'krita/4.1'.

Fix assert when trying to merge down a group with a transform mask

We should be very careful about passing node pointers in queued signals.
Sometimes it may happen that the signal is delivered *after* the node has
been removed from the layers graph. If it is possible and we should avoid
that, e.g. activating this node, we should check node's graph listener's
pointer.

M  +6    -2    libs/ui/canvas/kis_display_color_converter.cpp
M  +2    -0    libs/ui/flake/kis_dummies_facade_base.cpp
M  +9    -0    libs/ui/kis_node_manager.cpp

https://commits.kde.org/krita/223f0d2d0bc13e8378ad48ecf414291ac977624c
Comment 6 Andrey 2018-06-26 15:09:52 UTC
Git commit 7ac310a2a2da6e0eba2519ea65fba7c7ac05b86b by Andrey Kamakin, on behalf of Dmitry Kazakov.
Committed on 26/06/2018 at 14:18.
Pushed by akamakin into branch 'akamakin/T8628-multithreading-optimization'.

Fix assert when trying to merge down a group with a transform mask

We should be very careful about passing node pointers in queued signals.
Sometimes it may happen that the signal is delivered *after* the node has
been removed from the layers graph. If it is possible and we should avoid
that, e.g. activating this node, we should check node's graph listener's
pointer.

M  +6    -2    libs/ui/canvas/kis_display_color_converter.cpp
M  +2    -0    libs/ui/flake/kis_dummies_facade_base.cpp
M  +9    -0    libs/ui/kis_node_manager.cpp

https://commits.kde.org/krita/7ac310a2a2da6e0eba2519ea65fba7c7ac05b86b