Bug 428260 - Attempt to use move tool on selected region crashes Krita.
Summary: Attempt to use move tool on selected region crashes Krita.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Move (show other bugs)
Version: 4.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-10-26 07:47 UTC by AE_2
Modified: 2020-10-27 11:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AE_2 2020-10-26 07:47:07 UTC
SUMMARY
Work-stopping behavior despite basic functions. Cannot move a selected region; Krita crashes.

STEPS TO REPRODUCE
1. Select a region of an image or layer with one of the selection tools
2. Select the Move tool
3. Click-drag on screen to move the selection

OBSERVED RESULT
Krita crashes/exits immediately

EXPECTED RESULT
User is able to move the selection

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

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2020-10-26 09:05:29 UTC
I can confirm that an assert happens:

ASSERT (krita): "clonedData" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/libs/image/kis_strokes_queue.cpp, line 333
Aborted

I've asked Dmitry to take a look asap.
Comment 2 Dmitry Kazakov 2020-10-26 09:42:40 UTC
As a temporary workaround I would recommend to disable View->Instant Preview
Comment 3 Dmitry Kazakov 2020-10-27 11:26:02 UTC
Git commit 062aadf6104d9fb6a84d5a555a7378a551c14abe by Dmitry Kazakov.
Committed on 27/10/2020 at 11:18.
Pushed by dkazakov into branch 'krita/4.3'.

Fix a crash when trying to use Move Selection Tool on a raster selection

All the jobs of a stroke that supports Instant Preview must support
createLodClone() call.

M  +1    -1    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.h
M  +9    -0    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +3    -0    libs/ui/tool/strokes/move_stroke_strategy.h
M  +11   -0    plugins/tools/basictools/strokes/move_selection_stroke_strategy.cpp
M  +5    -0    plugins/tools/basictools/strokes/move_selection_stroke_strategy.h

https://invent.kde.org/graphics/krita/commit/062aadf6104d9fb6a84d5a555a7378a551c14abe
Comment 4 Dmitry Kazakov 2020-10-27 11:26:10 UTC
Git commit 62f487a6807f60d0a075deba4a052ebe0a565802 by Dmitry Kazakov.
Committed on 27/10/2020 at 11:18.
Pushed by dkazakov into branch 'krita/4.3'.

Workaround a deadlock when painting on a vector selection with Instant Preview

Instant Preview is based on running two consequent with different
level of detail, but our vector selection don't support that. More
than that, when starting a paint operation on a vector selection,
it should be flattened into a pixel selection. Which means that in LoD
mode the flattening will happen twice.

Ideally, we should somehow make KisSelection survive flattening in
two separate LoD strokes, but I'm not sure it is really worth the
effort.

The downsides of the patch are:

1) The first painting stroke on a selection based layer or
   mask with vector selection will always be executed without
   instant preview. It affects all mask, generator layers and
   filter layers.

2) The first applicaiton of a filter on such a layer will also
   be slow.
CC:kimageshop@kde.org

M  +5    -0    libs/image/kis_base_node.cpp
M  +6    -0    libs/image/kis_base_node.h
M  +5    -0    libs/image/kis_mask.cc
M  +2    -0    libs/image/kis_mask.h
M  +5    -0    libs/image/kis_selection_based_layer.cpp
M  +2    -0    libs/image/kis_selection_based_layer.h
M  +1    -0    libs/ui/tool/strokes/freehand_stroke.cpp
M  +1    -0    libs/ui/tool/strokes/kis_filter_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/62f487a6807f60d0a075deba4a052ebe0a565802
Comment 5 Dmitry Kazakov 2020-10-27 11:27:12 UTC
Git commit 5452eb122d0f530ab8c8208593b93550edba6f7f by Dmitry Kazakov.
Committed on 27/10/2020 at 11:26.
Pushed by dkazakov into branch 'krita/4.4.0'.

Fix a crash when trying to use Move Selection Tool on a raster selection

All the jobs of a stroke that supports Instant Preview must support
createLodClone() call.

M  +1    -1    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.h
M  +9    -0    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +3    -0    libs/ui/tool/strokes/move_stroke_strategy.h
M  +11   -0    plugins/tools/basictools/strokes/move_selection_stroke_strategy.cpp
M  +5    -0    plugins/tools/basictools/strokes/move_selection_stroke_strategy.h

https://invent.kde.org/graphics/krita/commit/5452eb122d0f530ab8c8208593b93550edba6f7f
Comment 6 Dmitry Kazakov 2020-10-27 11:27:21 UTC
Git commit 90a75b4ba8d57a8cdae6035d1b82619c2f4e30d5 by Dmitry Kazakov.
Committed on 27/10/2020 at 11:26.
Pushed by dkazakov into branch 'krita/4.4.0'.

Workaround a deadlock when painting on a vector selection with Instant Preview

Instant Preview is based on running two consequent with different
level of detail, but our vector selection don't support that. More
than that, when starting a paint operation on a vector selection,
it should be flattened into a pixel selection. Which means that in LoD
mode the flattening will happen twice.

Ideally, we should somehow make KisSelection survive flattening in
two separate LoD strokes, but I'm not sure it is really worth the
effort.

The downsides of the patch are:

1) The first painting stroke on a selection based layer or
   mask with vector selection will always be executed without
   instant preview. It affects all mask, generator layers and
   filter layers.

2) The first applicaiton of a filter on such a layer will also
   be slow.
CC:kimageshop@kde.org

M  +5    -0    libs/image/kis_base_node.cpp
M  +6    -0    libs/image/kis_base_node.h
M  +5    -0    libs/image/kis_mask.cc
M  +2    -0    libs/image/kis_mask.h
M  +5    -0    libs/image/kis_selection_based_layer.cpp
M  +2    -0    libs/image/kis_selection_based_layer.h
M  +1    -0    libs/ui/tool/strokes/freehand_stroke.cpp
M  +1    -0    libs/ui/tool/strokes/kis_filter_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/90a75b4ba8d57a8cdae6035d1b82619c2f4e30d5
Comment 7 Dmitry Kazakov 2020-10-27 11:27:33 UTC
Git commit fe6d1d6c4456e57b250aef70662a56d4b4cc2f16 by Dmitry Kazakov.
Committed on 27/10/2020 at 11:27.
Pushed by dkazakov into branch 'master'.

Workaround a deadlock when painting on a vector selection with Instant Preview

Instant Preview is based on running two consequent with different
level of detail, but our vector selection don't support that. More
than that, when starting a paint operation on a vector selection,
it should be flattened into a pixel selection. Which means that in LoD
mode the flattening will happen twice.

Ideally, we should somehow make KisSelection survive flattening in
two separate LoD strokes, but I'm not sure it is really worth the
effort.

The downsides of the patch are:

1) The first painting stroke on a selection based layer or
   mask with vector selection will always be executed without
   instant preview. It affects all mask, generator layers and
   filter layers.

2) The first applicaiton of a filter on such a layer will also
   be slow.
CC:kimageshop@kde.org

M  +5    -0    libs/image/kis_base_node.cpp
M  +6    -0    libs/image/kis_base_node.h
M  +5    -0    libs/image/kis_mask.cc
M  +2    -0    libs/image/kis_mask.h
M  +5    -0    libs/image/kis_selection_based_layer.cpp
M  +2    -0    libs/image/kis_selection_based_layer.h
M  +1    -0    libs/ui/tool/strokes/freehand_stroke.cpp
M  +1    -0    libs/ui/tool/strokes/kis_filter_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/fe6d1d6c4456e57b250aef70662a56d4b4cc2f16
Comment 8 Dmitry Kazakov 2020-10-27 11:27:41 UTC
Git commit 5bd2b1ac3e877d6b38faf2a2415ee5adf294a206 by Dmitry Kazakov.
Committed on 27/10/2020 at 11:27.
Pushed by dkazakov into branch 'master'.

Fix a crash when trying to use Move Selection Tool on a raster selection

All the jobs of a stroke that supports Instant Preview must support
createLodClone() call.

M  +1    -1    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.h
M  +9    -0    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +3    -0    libs/ui/tool/strokes/move_stroke_strategy.h
M  +11   -0    plugins/tools/basictools/strokes/move_selection_stroke_strategy.cpp
M  +5    -0    plugins/tools/basictools/strokes/move_selection_stroke_strategy.h

https://invent.kde.org/graphics/krita/commit/5bd2b1ac3e877d6b38faf2a2415ee5adf294a206