Bug 447506 - Transform Mask in Group Layer with Pass Through make Krita crash
Summary: Transform Mask in Group Layer with Pass Through make Krita crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 5.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-25 11:45 UTC by Protoniv
Modified: 2022-01-05 13:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
^ Backtrace of the crash (33.40 KB, text/plain)
2021-12-25 12:44 UTC, David REVOY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Protoniv 2021-12-25 11:45:22 UTC
SUMMARY
Making a transform mask binding to a group layer with pass-through enable first, then switch to transform tool trying to modify the transform mask will cause krita crash.

STEPS TO REPRODUCE
1. Open new file, draw something, Ctrl+G to fast group the paint layer with a group layer.
2. Enable group layer pass through, then create a transform mask 
3. switch to transform tool to transform, and it crash

OBSERVED RESULT
Crash when switch to transform tool

EXPECTED RESULT
Since the transform mask name is grey when pass-through enable, maybe show some warning and not crash?

SOFTWARE/OS VERSIONS
Windows: Windows 10 20H2

ADDITIONAL INFORMATION
Can't find a crash log, only krita.log, but seems the bug is the same as bug 405161
Comment 1 David REVOY 2021-12-25 12:44:23 UTC
Created attachment 144856 [details]
^ Backtrace of the crash

Hi, thanks for the steps; I could reproduce on krita-5.0.0-x86_64.appimage on Kubuntu 20.04. 
I attach a backtrace to the crash and switch the ticket to 'confirmed'.

(Note: the transform mask layer name was grayed out, and the text was decorated with striked letter, before starting the transformation.)
Comment 2 Protoniv 2021-12-26 01:41:42 UTC
(In reply to David REVOY from comment #1)
> I attach a backtrace to the crash and switch the ticket to 'confirmed'.
> 
> (Note: the transform mask layer name was grayed out, and the text was
> decorated with striked letter, before starting the transformation.)
Thank you David!
I didn't notice the strike, seems my monitor is just too dim in my daily use.
Comment 3 Dmitry Kazakov 2021-12-27 15:17:39 UTC
Git commit 0edcc3bc9e5753a43e8ff90024ad66a48b019674 by Dmitry Kazakov.
Committed on 27/12/2021 at 15:17.
Pushed by dkazakov into branch 'master'.

Quick workaround a crash in transform mask applied to a passthrough group

Jus deslare the assert as "safe". The proper fix is coming.

M  +1    -1    libs/image/kis_layer.cc

https://invent.kde.org/graphics/krita/commit/0edcc3bc9e5753a43e8ff90024ad66a48b019674
Comment 4 Dmitry Kazakov 2021-12-27 15:18:08 UTC
Git commit 369915fe1b1c4fdb09459ffa99d805b071e41751 by Dmitry Kazakov.
Committed on 27/12/2021 at 15:17.
Pushed by dkazakov into branch 'krita/5.0.0'.

Quick workaround a crash in transform mask applied to a passthrough group

Jus deslare the assert as "safe". The proper fix is coming.

M  +1    -1    libs/image/kis_layer.cc

https://invent.kde.org/graphics/krita/commit/369915fe1b1c4fdb09459ffa99d805b071e41751
Comment 5 Dmitry Kazakov 2021-12-27 15:18:27 UTC
Git commit 603a2f6ca4c7117dcd919984e2e2b95856b674db by Dmitry Kazakov.
Committed on 27/12/2021 at 15:18.
Pushed by dkazakov into branch 'krita/5.0'.

Quick workaround a crash in transform mask applied to a passthrough group

Jus deslare the assert as "safe". The proper fix is coming.

M  +1    -1    libs/image/kis_layer.cc

https://invent.kde.org/graphics/krita/commit/603a2f6ca4c7117dcd919984e2e2b95856b674db
Comment 6 Dmitry Kazakov 2022-01-05 13:08:40 UTC
Git commit 04a7131f0a7c06a0bcd87f297fc6e05c6924bd8f by Dmitry Kazakov.
Committed on 05/01/2022 at 13:08.
Pushed by dkazakov into branch 'master'.

Make sure transform tool cannot be triggered for a dropped transform mask

When a mask is applied to a pass-through group, it is dropped from the
rendering tree. So it is not possible to trigger transform tool for that.

M  +9    -0    plugins/tools/tool_transform2/strokes/inplace_transform_stroke_strategy.cpp
M  +9    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/04a7131f0a7c06a0bcd87f297fc6e05c6924bd8f
Comment 7 Dmitry Kazakov 2022-01-05 13:08:57 UTC
Git commit 3e1dde3d6f080b0f7d9d43a0af7a06245c9e5e77 by Dmitry Kazakov.
Committed on 05/01/2022 at 13:08.
Pushed by dkazakov into branch 'krita/5.0'.

Make sure transform tool cannot be triggered for a dropped transform mask

When a mask is applied to a pass-through group, it is dropped from the
rendering tree. So it is not possible to trigger transform tool for that.
(cherry picked from commit 04a7131f0a7c06a0bcd87f297fc6e05c6924bd8f)

M  +9    -0    plugins/tools/tool_transform2/strokes/inplace_transform_stroke_strategy.cpp
M  +9    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/commit/3e1dde3d6f080b0f7d9d43a0af7a06245c9e5e77