Bug 512601

Summary: [5.3] Crash when using Comic Panel Editing Tool
Product: [Applications] krita Reporter: Door1 <a.pond105>
Component: Tools/VectorAssignee: Tiar <tamtamy.tymona>
Status: RESOLVED FIXED    
Severity: crash CC: dra.w.p.il.e+bugskde, tamtamy.tymona
Priority: NOR Keywords: triaged
Version First Reported In: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Android   
OS: Android 14.x   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Krita crash log

Description Door1 2025-11-25 16:21:25 UTC
Created attachment 187165 [details]
Krita crash log

SUMMARY
Crash when using Comic Panel Editing Tool

STEPS TO REPRODUCE
1. Make a vector layer, and draw a circle with the Ellipse Tool
2. Switch to Comic Panel Editing Tool
3. In the Tool Options docker, select the rightmost icon. (Looks like a square with a single line inside of it)
4. Use the tool on the circle

OBSERVED RESULT
Krita will either crash, or give you the following message:

Krita has encountered an internal error:

SAFE ASSERT (krita): "segment.length() == 2" in file /builds/graphics/krita/libs/global/kis_algebra_2d.cpp, line 1907

Ignoring the message then results in a crash.

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
Android 14
arm64
Krita 5.3 nightly
git e7dd32a (Nov. 24, 2025)
Comment 1 dra.w.p.il.e+bugskde 2025-12-06 10:13:36 UTC
Also reproduces on Linux.
Comment 2 Dmitry Kazakov 2026-01-06 10:41:30 UTC
Git commit e5c8d9063bd9c56af75330752c004c0202a7628c by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 06/01/2026 at 10:40.
Pushed by dkazakov into branch 'master'.

Fix crash on wrong indexes in RemoveGutter in KnifeTool

Before this commit, mergeShapesWithGutter would expect
the VectorPath-based indexes, while getLineSegmentIndexes...
would provide QpainterPath-based indexes. This commit
ensures that they're not mixed up, and adds additional checks
in the code to prevent a crash.

M  +37   -7    libs/global/kis_algebra_2d.cpp

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