Bug 497389 - Unlocking undone merged hidden locked layer raises safe assert
Summary: Unlocking undone merged hidden locked layer raises safe assert
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-12 20:42 UTC by Vitamorus
Modified: 2024-12-13 09:23 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitamorus 2024-12-12 20:42:40 UTC
That title is a mess, but I'll explain. While testing Bug 431431 I was playing around with merging hidden layers and managed to raise a safe assert. 

To reproduce:
1. Open Krita and create a new document
2. Create 3 layers
3. Hide layer 2 and then lock it (in that order!)
4. Select all 3 layers and merge them
5. Undo the merge (Ctrl + Z) 
6. Unlock layer 2
7. A dialog with a safe assert should appear reading:

"SAFE ASSERT (krita): "m_newPropertyList == other->m_oldPropertyList" in file /builds/graphics/krita/libs/image/commands/kis_node_property_list_command.cpp, line 113"

Log output:
================================================================================
SESSION: 12 Dec 2024 21:25:21 +0100. Executing /tmp/.mount_krita-wmWfjj/usr/bin/krita

Krita Version: 5.3.0-prealpha (git 021e347), Qt version compiled: 5.15.7, loaded: 5.15.7. Process ID: 15704
-- -- -- -- -- -- -- --
12 Dec 2024 21:25:21 +0100: Style: fusion. Available styles: Windows, Fusion
12 Dec 2024 21:25:22 +0100: Database is up to date. Version: 0.0.17, created by Krita 5.2.2, at Wed Feb 28 22:46:18 2024
12 Dec 2024 21:25:25 +0100: KisAppimageUpdater: update check finished. Result: 1 Exit status: 0
path: /.../krita-5.3.0-prealpha-021e347922-x86_64.AppImage
output: 
12 Dec 2024 21:25:27 +0100: Created image "Unnamed", 3200 * 2000 pixels, 300 dpi. Color model: 8-bit integer/channel RGB/Alpha (sRGB-elle-V2-srgbtrc.icc). Layers: 1
12 Dec 2024 21:25:38 +0100: SAFE ASSERT (krita): "root->visible()" in file /builds/graphics/krita/libs/image/kis_layer_utils.cpp, line 1118
12 Dec 2024 21:25:40 +0100: SAFE ASSERT (krita): "m_newPropertyList == other->m_oldPropertyList" in file /builds/graphics/krita/libs/image/commands/kis_node_property_list_command.cpp, line 113

KRITA DID NOT CLOSE CORRECTLY
================================================================================
Comment 1 Dmitry Kazakov 2024-12-13 08:58:53 UTC
Hi, Vitamorus!

Thank you for the report! I can reproduce it! :)
Comment 2 Dmitry Kazakov 2024-12-13 09:22:29 UTC
Git commit 943d8e5fdc18336a44663651a76c701817e19df3 by Dmitry Kazakov.
Committed on 13/12/2024 at 09:22.
Pushed by dkazakov into branch 'master'.

Fix an assert when undoing merging of locked layers

M  +2    -1    libs/image/commands/kis_image_change_visibility_command.cpp
M  +1    -0    libs/image/commands/kis_image_change_visibility_command.h

https://invent.kde.org/graphics/krita/-/commit/943d8e5fdc18336a44663651a76c701817e19df3
Comment 3 Dmitry Kazakov 2024-12-13 09:22:37 UTC
Git commit ec7a3aa98d538a8c58aa99d5f29e803dd15857a8 by Dmitry Kazakov.
Committed on 13/12/2024 at 09:22.
Pushed by dkazakov into branch 'master'.

Fix a safe assert when merging invisible and locked layer

Normally we just delete the invisible layers without trying to
merge them down. But if the layer is locked, we should just leave
it alone.

M  +6    -1    libs/image/kis_layer_utils.cpp

https://invent.kde.org/graphics/krita/-/commit/ec7a3aa98d538a8c58aa99d5f29e803dd15857a8
Comment 4 Dmitry Kazakov 2024-12-13 09:22:52 UTC
Git commit 0c897c089fcdb313fbc9697e29ad7eb5cb8f473c by Dmitry Kazakov.
Committed on 13/12/2024 at 09:22.
Pushed by dkazakov into branch 'krita/5.2'.

Fix a safe assert when merging invisible and locked layer

Normally we just delete the invisible layers without trying to
merge them down. But if the layer is locked, we should just leave
it alone.

M  +6    -1    libs/image/kis_layer_utils.cpp

https://invent.kde.org/graphics/krita/-/commit/0c897c089fcdb313fbc9697e29ad7eb5cb8f473c
Comment 5 Dmitry Kazakov 2024-12-13 09:23:00 UTC
Git commit ec6ee4d1d6c67e3ae7647d169417dad9de582414 by Dmitry Kazakov.
Committed on 13/12/2024 at 09:22.
Pushed by dkazakov into branch 'krita/5.2'.

Fix an assert when undoing merging of locked layers

M  +2    -1    libs/image/commands/kis_image_change_visibility_command.cpp
M  +1    -0    libs/image/commands/kis_image_change_visibility_command.h

https://invent.kde.org/graphics/krita/-/commit/ec6ee4d1d6c67e3ae7647d169417dad9de582414