Bug 419189 - Krita crashes when undo a clear Assistants
Summary: Krita crashes when undo a clear Assistants
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Assistants (show other bugs)
Version: 4.2.8
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Emmet O'Neill
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2020-03-24 18:23 UTC by fahmi.keren96
Modified: 2020-05-05 07:27 UTC (History)
3 users (show)

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


Attachments
Crashlog (60.89 KB, text/plain)
2020-03-24 18:23 UTC, fahmi.keren96
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fahmi.keren96 2020-03-24 18:23:46 UTC
Created attachment 126987 [details]
Crashlog

SUMMARY
Krita crashes when attempts undo after clearing Assistants, deleting assistant individually doesnt causes crash.

STEPS TO REPRODUCE
Using the assistant tools to create an assistant.
Press the delete all assistant button/clear assistant.
Undo

OBSERVED RESULT
It Crashes.

EXPECTED RESULT
Should have restored the assistant, or just skip the undo.

SOFTWARE/OS VERSIONS
Windows: Windows 10

ADDITIONAL INFORMATION
HardWare: Acer Aspire Swift 3. MX150 card, i5 cpu, 8 gigs of ram.
Comment 1 Rebecca Breu 2020-03-24 19:16:26 UTC
I can confirm this on 4.2.8, the 4.2.9 beta. My compiled master build gives me an assert:

ASSERT (krita): "curAssistants.size() == assistants.size() + 1" in file /home/appimage/persistent/krita/plugins/assistants/Assistants/EditAssistantsCommand.cpp, line 62
Comment 2 Halla Rempt 2020-05-04 09:28:50 UTC
Note: the assert should not be present in release builds, but just removing them doesn't make undo work. There's a bit of work here.
Comment 3 Emmet O'Neill 2020-05-05 02:05:00 UTC
Git commit 8e3f993a77b129e5b5406e753b34efc8b5d4c719 by Emmet O'Neill.
Committed on 05/05/2020 at 01:46.
Pushed by emmetoneill into branch 'master'.

Fixed bad assertion and failure to undo removeAllAssistants.

KisAssistantTool::removeAllAssistants function wasn't making correct use
of EditAssistantsCommand. EditAssistantsCommand also contained a flawed and
unnecessary assertion.

Thanks for the help Eoin.

M  +10   -11   plugins/assistants/Assistants/EditAssistantsCommand.cpp
M  +6    -5    plugins/assistants/Assistants/kis_assistant_tool.cc

https://invent.kde.org/kde/krita/commit/8e3f993a77b129e5b5406e753b34efc8b5d4c719
Comment 4 Halla Rempt 2020-05-05 07:27:22 UTC
Git commit 0ac7f9fde8f1bbfc4823d03753d47fc43b059e74 by Boudewijn Rempt, on behalf of Emmet O'Neill.
Committed on 05/05/2020 at 07:27.
Pushed by rempt into branch 'krita/4.3'.

Fixed bad assertion and failure to undo removeAllAssistants.

KisAssistantTool::removeAllAssistants function wasn't making correct use
of EditAssistantsCommand. EditAssistantsCommand also contained a flawed and
unnecessary assertion.

Thanks for the help Eoin.
(cherry picked from commit 8e3f993a77b129e5b5406e753b34efc8b5d4c719)

M  +10   -11   plugins/assistants/Assistants/EditAssistantsCommand.cpp
M  +6    -5    plugins/assistants/Assistants/kis_assistant_tool.cc

https://invent.kde.org/kde/krita/commit/0ac7f9fde8f1bbfc4823d03753d47fc43b059e74