Bug 382315 - Duplicating Global Selection mask crash
Summary: Duplicating Global Selection mask crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: git master (please specify the git hash!)
Platform: unspecified All
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
: 388874 394024 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-13 19:37 UTC by Scott Petrovic
Modified: 2018-05-09 07:28 UTC (History)
9 users (show)

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


Attachments
(GDB report) (7.97 KB, text/plain)
2017-07-14 05:16 UTC, mvowada
Details
New crash information added by DrKonqi (7.26 KB, text/plain)
2018-02-17 23:51 UTC, Jose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Petrovic 2017-07-13 19:37:56 UTC
I tested this out on my windows 10 machine on master

1. Start it up, create a new file, mark a selection. 
2. In the select main menu, enable "Show Global Selection Mask" 
3. in the Layer list, right click on the selection mask "layer" and pick "Duplicate"

Expected Result:
duplicate the layer (or have it disabled so you cannot click it)

Actual resullt: 
Krita crashes
Comment 1 Scott Petrovic 2017-07-13 19:43:07 UTC
For step 1, I meant create a selection. I just used the rectangle selection tool and made a small rectangle selection
Comment 2 mvowada 2017-07-14 05:16:19 UTC
Created attachment 106602 [details]
(GDB report)

Hi, I can confirm this on Ubuntu and Krita 4 Pre-Alpha as well.
Comment 3 Alvin Wong 2017-07-14 11:57:30 UTC
I can confirm on 3.1.4 stable (Windows x64).
Comment 4 Halla Rempt 2017-11-24 10:36:09 UTC
Proper backtrace:

hread 1 (Thread 0x7fa18e9d6940 (LWP 11955)):
[KCrash Handler]
#6  0x00007fa18dd5db98 in KisSharedPtr<KisNode>::KisSharedPtr(KisSharedPtr<KisNode> const&) (this=0x7ffed066f510, o=...) at /home/boud/dev/krita/libs/global/kis_shared_ptr.h:100
#7  0x00007fa18de3dd55 in KisNodeDummy::node() const (this=0x0) at /home/boud/dev/krita/libs/ui/flake/kis_node_dummies_graph.cpp:83
#8  0x00007fa13a454abd in TimelineFramesIndexConverter::isDummyVisible(KisNodeDummy*) const (this=0xd8be9a8, dummy=0x0) at /home/boud/dev/krita/plugins/dockers/animation/timeline_frames_index_converter.cpp:138
#9  0x00007fa13a45590c in TimelineNodeListKeeper::slotDummyChanged(KisNodeDummy*) (this=0xd8beec0, dummy=0x0) at /home/boud/dev/krita/plugins/dockers/animation/timeline_node_list_keeper.cpp:212
#10 0x00007fa13a47cc9d in TimelineNodeListKeeper::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0xd8beec0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7ffed066f710) at /home/boud/dev/b-krita/plugins/dockers/animation/moc_timeline_node_list_keeper.cpp:86
#11 0x00007fa1838891df in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib64/libQt5Core.so.5
#12 0x00007fa18e25fb23 in KisDummiesFacadeBase::sigDummyChanged(KisNodeDummy*) (this=0xa64e940, _t1=0x0) at /home/boud/dev/b-krita/libs/ui/moc_kis_dummies_facade_base.cpp:294
#13 0x00007fa18de4000c in KisDummiesFacadeBase::slotNodeChanged(KisSharedPtr<KisNode>) (this=0xa64e940, node=...) at /home/boud/dev/krita/libs/ui/flake/kis_dummies_facade_base.cpp:97
#14 0x00007fa18e25f2c8 in KisDummiesFacadeBase::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0xa64e940, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fa0f80131c0) at /home/boud/dev/b-krita/libs/ui/moc_kis_dummies_facade_base.cpp:143
#15 0x00007fa18388ab26 in QObject::event(QEvent*) () at /usr/lib64/libQt5Core.so.5
#16 0x00007fa18479bcbc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#17 0x00007fa1847a2a10 in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#18 0x00007fa18e17554b in KisApplication::notify(QObject*, QEvent*) (this=0x7ffed066ff60, receiver=0xa64e940, event=0x7fa0f8013200) at /home/boud/dev/krita/libs/ui/KisApplication.cpp:599
#19 0x00007fa18385fd25 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#20 0x00007fa183862303 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib64/libQt5Core.so.5
#21 0x00007fa1838b1593 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /usr/lib64/libQt5Core.so.5
#22 0x00007fa17ec53134 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#23 0x00007fa17ec53388 in  () at /usr/lib64/libglib-2.0.so.0
#24 0x00007fa17ec5342c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#25 0x00007fa1838b0dbc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#26 0x00007fa18385e01b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#27 0x00007fa1838665e4 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#28 0x000000000040a083 in main(int, char**) (argc=1, argv=0x7ffed0670818) at /home/boud/dev/krita/krita/main.cc:305
Comment 5 Halla Rempt 2018-01-13 09:41:48 UTC
*** Bug 388874 has been marked as a duplicate of this bug. ***
Comment 6 Jose 2018-02-17 23:51:46 UTC
Created attachment 110767 [details]
New crash information added by DrKonqi

krita (3.3.3) using Qt 5.9.3

Load an image
Select a rectangle
Select thee layer with the selection
Rotate thee layer with the selection
Duplicate the layer with the selection
Crash

-- Backtrace (Reduced):
#6  0x00007fcf73c94410 in KisNodeDummy::node() const () from /usr/lib/x86_64-linux-gnu/libkritaui.so.18
#7  0x00007fcf27e4a1b6 in TimelineFramesIndexConverter::isDummyVisible(KisNodeDummy*) const () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritaanimationdocker.so
#8  0x00007fcf27e4b708 in TimelineNodeListKeeper::slotDummyChanged(KisNodeDummy*) () from /usr/lib/x86_64-linux-gnu/kritaplugins/kritaanimationdocker.so
[...]
#10 0x00007fcf73fe5822 in KisDummiesFacadeBase::sigDummyChanged(KisNodeDummy*) () from /usr/lib/x86_64-linux-gnu/libkritaui.so.18
#11 0x00007fcf73c95d63 in KisDummiesFacadeBase::slotNodeChanged(KisSharedPtr<KisNode>) () from /usr/lib/x86_64-linux-gnu/libkritaui.so.18
Comment 7 Celeste Wouters 2018-04-24 15:44:33 UTC
Can confirm for 4.0.1 stable w/ Qt 5.10.1 on Arch Linux. Backtrace is the same as previously observed.
Comment 8 Dmitry Kazakov 2018-04-24 17:27:07 UTC
Still actual
Comment 9 Antti Savolainen 2018-04-24 17:34:46 UTC
On krita-testing from the Krita Lime PPA. Adding a video of the crash: https://webmshare.com/Gm7v8

Changing the platform from MS Windows to all.

Same stacktrace as well.
Comment 10 Dmitry Kazakov 2018-04-25 12:36:15 UTC
Git commit e58c344bf34661e499294cc179a457192232a2c1 by Dmitry Kazakov.
Committed on 25/04/2018 at 12:32.
Pushed by dkazakov into branch 'master'.

Fix a crash when duplicating active global selection masks

The problem was in the fact that KisGroupLayer::allowAsChild()
forbade adding the second active mask to the same layer, letting
the code silently continue without knowing that the mask was not
created. In this patch we manually deactivate all the active masks
before duplication process.

M  +4    -4    libs/image/kis_node.cpp
M  +37   -2    libs/ui/kis_node_juggler_compressed.cpp

https://commits.kde.org/krita/e58c344bf34661e499294cc179a457192232a2c1
Comment 11 Halla Rempt 2018-05-02 11:59:19 UTC
Git commit 6a98d072fbef812c54655dfbb1d8ffd31923307f by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 02/05/2018 at 11:54.
Pushed by rempt into branch 'krita/4.0'.

Fix a crash when duplicating active global selection masks

The problem was in the fact that KisGroupLayer::allowAsChild()
forbade adding the second active mask to the same layer, letting
the code silently continue without knowing that the mask was not
created. In this patch we manually deactivate all the active masks
before duplication process.
(cherry picked from commit 3ef241fbe5eaec159300dc28ce6e5b89fb7bffa6)

M  +4    -4    libs/image/kis_node.cpp
M  +37   -2    libs/ui/kis_node_juggler_compressed.cpp

https://commits.kde.org/krita/6a98d072fbef812c54655dfbb1d8ffd31923307f
Comment 12 Antti Savolainen 2018-05-09 07:28:43 UTC
*** Bug 394024 has been marked as a duplicate of this bug. ***