Bug 435056 - Safe asserts both when undoing and redoing a selection mask after copying contents
Summary: Safe asserts both when undoing and redoing a selection mask after copying con...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.4.3
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-03-28 10:20 UTC by tomtomtomreportingin
Modified: 2022-06-03 20:42 UTC (History)
4 users (show)

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


Attachments
Undo-Stack (Failed Attempt to Reproduce) (18.74 KB, image/png)
2021-05-03 20:47 UTC, Eoin O'Neill
Details
Minimum necessary undo history to produce the safe assert (7.10 KB, image/png)
2021-08-04 13:10 UTC, tomtomtomreportingin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2021-03-28 10:20:59 UTC
SUMMARY
Regression introduced in 4.3.0: Krita throws safe asserts when the user creates a selection mask, copies the contents, then performs certain undo/redo actions.

STEPS TO REPRODUCE
1. Draw something.
2. Freehand select it.
3. Copy it.
4. Undo twice. (the Copy action appears to be its own action in the undo stack)

OBSERVED RESULT
SAFE ASSERT (krita): "changeList.memento == memento" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/libs/image/tiles3/kis_memento_manager.cc, line 285

When redoing after the above assert:

SAFE ASSERT (krita): "changeList.memento == memento" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/libs/image/tiles3/kis_memento_manager.cc, line 342

EXPECTED RESULT
No asserts.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.12.9 (Appimage)  

ADDITIONAL INFORMATION
Also occurs in master. Happens with both raster and vector selections.
Comment 1 Ahab Greybeard 2021-04-01 10:04:32 UTC
I can confirm this for the Mar 30 5.0.0-prealpha (git 783e86c) appimage.

The Copy action is needed. It doesnt happen if you do a brushstroke after the freehand (or any type of) selection.
Comment 2 Halla Rempt 2021-04-01 10:12:56 UTC
Strange... I must be doing something wrong, since I cannot reproduce this.
Comment 3 tomtomtomreportingin 2021-04-03 08:54:45 UTC
If step 2 is skipped and you copy the whole layer, the Copy action isn't considered an item in the undo stack, and the safe assert doesn't happen at all when undoing twice.
Comment 4 Eoin O'Neill 2021-05-03 20:47:52 UTC
Created attachment 138123 [details]
Undo-Stack (Failed Attempt to Reproduce)

I'm also unable to reproduce this bug. Since this is important for the upcoming release, could you please give us more information by providing a screenshot of the minimum undo stack that this occurs to you? Also, perhaps provide a canvas size and color space details. 

I've attached my undo stack to the attachments list. It seems like even the copy item being its own element in the undo stack isn't enough to have this guarantee to happen during undo/redo operations.
Comment 5 Eoin O'Neill 2021-05-03 20:58:02 UTC
For the time being, I'm changing the status of this to NEEDSINFO > WORKSFORME.

I will continue to track this as it is under my assignment.
Comment 6 Bug Janitor Service 2021-05-18 04:33:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2021-06-02 04:33:38 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 8 tomtomtomreportingin 2021-08-04 13:10:27 UTC
Created attachment 140513 [details]
Minimum necessary undo history to produce the safe assert
Comment 9 tomtomtomreportingin 2021-08-04 13:13:47 UTC
The above attachment is from Krita 4.4.5 with A5 600 DPI canvas size and default 8-bit color. The safe assert occurs when undoing to "Freehand Brush Stroke".
Comment 10 Eoin O'Neill 2021-09-14 21:59:57 UTC
Tomtomtom,

I'm still having issues reproducing this. I've tried it through the flatpak, appimage and master versions of krita with no success. I'm going to have to guess there's something external to Krita at work here.
Comment 11 Ahab Greybeard 2021-09-15 06:42:40 UTC
I can't get the asserts with 4.4.5 or any version now.
The only change from before, that I can think of, is that I do an update and distribution upgrade of my Debian 10 system every month.
Comment 12 Dmitry Kazakov 2021-09-15 11:16:21 UTC
The assert should have been fixed in a87dced5f88f26e282dfc86d18a3c32ecf68fa96

Though I cannot check if the patch is included into the reporter's version
Comment 13 tomtomtomreportingin 2021-09-15 15:49:22 UTC
The issue still happens for me in Krita 5. I've compared the behavior and configuration between my regular environment and a /tmp/ environment, and it seems to only happen with a Pixel selection nowadays.
Comment 14 Dmitry Kazakov 2022-06-03 10:36:46 UTC
Hi, Tomtomtom!

Could you check if you still can reproduce the problem in the current Krita-Next?

https://binary-factory.kde.org/job/Krita_Nightly_Windows_Build/

I cannot reproduce the problem, neither with pixel selections nor with vector selections :(
Comment 15 tomtomtomreportingin 2022-06-03 20:42:38 UTC
I can not reproduce the problem anymore, so I suppose it's been resolved in some way.