Bug 523070 - Combined shapes plus redo operations lead to a crash
Summary: Combined shapes plus redo operations lead to a crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layers/Vector (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Elena Sagalaeva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-15 00:22 UTC by Elena Sagalaeva
Modified: 2026-07-27 12:00 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elena Sagalaeva 2026-07-15 00:22:31 UTC
DESCRIPTION
Redoing the deletion of a combined shape causes a crash. 

STEPS TO REPRODUCE
1. Create a new document
2. Create a vector layer
2. Make two lines on the created vector layer
3. Select both lines with the "Edit Shapes Tool"
4. Connect any ends together via the "Join with Segment" function
5. Delete combined shape
6. Undo the deletion, undo the combine operation
8. Redo everything
9. Crash

OBSERVED RESULT
Krita crashes

EXPECTED RESULT
Krita shouldn't crash

SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a terminal window):
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

commit 2b927d92183e4722ac1561b25bc83b65438dffd7

	libkritaflake.dll!QScopedPointer<KoShapeContainer::Private,QScopedPointerDeleter<KoShapeContainer::Private> >::operator->() Line 118	C++
 	libkritaflake.dll!KoShapeContainer::shapeInterface() Line 172	C++
 	libkritaflake.dll!KoShape::setParent(KoShapeContainer * parent) Line 467	C++
 	libkritaflake.dll!KoShapeContainer::removeShape(KoShape * shape) Line 66	C++
 	libkritaflake.dll!KoShapeDeleteCommand::redo() Line 74	C++
 	libkritacommand.dll!KUndo2Command::redoMergedCommands() Line 424	C++
 	libkritacommand.dll!KUndo2QStack::redo() Line 989	C++
 	libkritaui.dll!UndoStack::redoImpl() Line 242	C++
 	libkritaui.dll!UndoStack::processPostponedJobs() Line 268	C++
 	libkritaui.dll!UndoStack::redo() Line 205	C++
 	libkritaui.dll!KisMainWindow::redo() Line 1547	C++
 	libkritaui.dll!KisMainWindow::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 436	C++
Comment 1 Elena Sagalaeva 2026-07-20 23:21:10 UTC
The issue is happening because Krita creates a new path shape each time during the "redo()" call. The subsequent operations don't know about it and continue to use the old one.

I used "Delete" to reproduce the issue, but other operations could be used instead. "Move", for example.
Comment 2 Bug Janitor Service 2026-07-21 03:47:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2870
Comment 3 Dmitry Kazakov 2026-07-27 11:59:09 UTC
Git commit 9ab35881aebecc78971292849d86558a79a39999 by Dmitry Kazakov, on behalf of Elena Sagalaeva.
Committed on 27/07/2026 at 11:50.
Pushed by dkazakov into branch 'master'.

Do not create a new path shape in KoMultiPathPointMergeCommand::redo() call

The subsequent operations don't know about the new shape and continue to
use the old one, which causes crashes.

M  +26   -20   libs/flake/commands/KoMultiPathPointMergeCommand.cpp
M  +63   -0    libs/flake/tests/TestPointMergeCommand.cpp
M  +3    -0    libs/flake/tests/TestPointMergeCommand.h

https://invent.kde.org/graphics/krita/-/commit/9ab35881aebecc78971292849d86558a79a39999
Comment 4 Dmitry Kazakov 2026-07-27 12:00:03 UTC
Git commit 478ddf4e6e5cebe3dbe0473d88d239c28e89ad01 by Dmitry Kazakov, on behalf of Elena Sagalaeva.
Committed on 27/07/2026 at 11:59.
Pushed by dkazakov into branch 'krita/6.0'.

Do not create a new path shape in KoMultiPathPointMergeCommand::redo() call

The subsequent operations don't know about the new shape and continue to
use the old one, which causes crashes.

M  +26   -20   libs/flake/commands/KoMultiPathPointMergeCommand.cpp
M  +63   -0    libs/flake/tests/TestPointMergeCommand.cpp
M  +3    -0    libs/flake/tests/TestPointMergeCommand.h

https://invent.kde.org/graphics/krita/-/commit/478ddf4e6e5cebe3dbe0473d88d239c28e89ad01