Bug 426424

Summary: Assert when undoing/redoing assistant changes too fast
Product: [Applications] krita Reporter: Dmitry Kazakov <dimula73>
Component: Tool/AssistantsAssignee: Krita Bugs <krita-bugs-null>
Severity: crash CC: ahab.greybeard
Priority: NOR    
Version: 4.3.0   
Target Milestone: ---   
Platform: Other   
OS: Other   
See Also: https://bugs.kde.org/show_bug.cgi?id=422428
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dmitry Kazakov 2020-09-11 20:28:56 UTC
1. Create 2 Vanishing point assistants
2. Modify them a lot to generate about 10 undo steps
3. Open Undo History docker
4. Click and hold mouse button on any undo step and start dragging back and forth.


ASSERT (krita): "newAssistants.size() < oldAssistants.size()" in file C:/dev/env-3/krita/plugins/assistants/Assistants/EditAssistantsCommand.cpp, line 61
Comment 1 Ahab Greybeard 2020-09-14 18:47:06 UTC
I can't reproduce this with the 4.3.0 appimage on Debian 10 or the 4.3.0 portable .zip on Windows 10.
Canvas content changes smoothly as mouse is dragged and nothing in the log.
Comment 2 Dmitry Kazakov 2020-09-24 12:57:36 UTC
Here is a video with the official Krita 4.4.0 Beta1 package: 
Comment 3 Ahab Greybeard 2020-09-24 14:08:43 UTC
I can now reproduce this with the 4.4.0-beta1 appimage.

It does not depend on the image size.
It does not depend on how many changes are in the Undo History docker.
You can do it with just one vanishing point.

The method is to manipulate the handles on the control lines so that the vanishing point is pushed off the canvas out to 'infinity' and then comes back from the other side of 'infinity'.
If that is done then a crash will happen with rapid wiping of the Undo History:

Terminal output:
ASSERT (krita): "newAssistants.size() > oldAssistants.size()" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/plugins/assistants/Assistants/EditAssistantsCommand.cpp, line 59
Comment 4 Ahab Greybeard 2020-10-03 13:07:00 UTC
Testing with the 4.4.0-beta2 appimage, there is the same crash with one ellipse assistant.
You can manipulate the control handles so that the ellipse goes off to infinity and the control handles are visible but the ellipse is not.
Leave it there and then manipulate control handles to bring it back from infinity.

Again, a crash with rapid wiping of the undo history:

ASSERT (krita): "newAssistants.size() < oldAssistants.size()" in file /home/appimage/workspace/Krita_Release_Appimage_Build/krita/plugins/assistants/Assistants/EditAssistantsCommand.cpp, line 61
Comment 5 Dmitry Kazakov 2021-08-02 10:34:35 UTC
It looks like the bug is fixed in Krita 5.0. I cannot reproduce it anymore.