<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>512649</bug_id>
          
          <creation_ts>2025-11-26 17:34:20 +0000</creation_ts>
          <short_desc>Segmentation fault after deleting vector layer and closing documet.</short_desc>
          <delta_ts>2026-01-27 16:32:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Layers/Vector</component>
          <version>git master (please specify the git hash!)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="wolthera">griffinvalley</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>dimula73</cc>
    
    <cc>penguinflyer2222</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/-/commit/4cc73f716bac902fda022c2415b9f211709d4fa1</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2472974</commentid>
    <comment_count>0</comment_count>
    <who name="wolthera">griffinvalley</who>
    <bug_when>2025-11-26 17:34:20 +0000</bug_when>
    <thetext>1. Open a document.
2. Add a vector layer
3. Add a shape
4. Add a text to the shape
5. Delete vector layer
6. Close document without saving.

GDB Backtrace:

Thread 1 &quot;krita&quot; received signal SIGSEGV, Segmentation fault.
0x00007ffff75a1234 in KisCanvas2::globalShapeManager() const () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
(gdb) bt
#0  0x00007ffff75a1234 in KisCanvas2::globalShapeManager() const () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#1  0x00007ffff77f10ec in KisSelectionManager::shapeSelectionChanged() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#2  0x00007ffff53152d3 in ?? () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#3  0x00007ffff75a44cc in KisCanvas2::localShapeManager() const () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#4  0x00007ffff75a490d in KisCanvas2::shapeManager() const () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#5  0x00007ffff43134f9 in KoCanvasBase::disconnectCanvasObserver(QObject*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaflake.so.20
#6  0x00007ffff75aabb5 in KisCanvas2::disconnectCanvasObserver(QObject*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#7  0x00007fffa88f7e66 in KisAnimCurvesDocker::setCanvas(KoCanvasBase*) () from /tmp/.mount_krita-AcilJH/usr/lib/kritaplugins/kritaanimationdocker.so
#8  0x00007ffff75e38bf in ?? () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#9  0x00007ffff75e398d in KoCanvasControllerWidget::setCanvas(KoCanvasBase*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#10 0x00007ffff7b9b9b7 in KisView::~KisView() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#11 0x00007ffff7b9c05d in KisView::~KisView() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#12 0x00007ffff53063de in QObjectPrivate::deleteChildren() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#13 0x00007ffff61aa6a6 in QWidget::~QWidget() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Widgets.so.5
#14 0x00007ffff62eceed in QMdiSubWindow::~QMdiSubWindow() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Widgets.so.5
#15 0x00007ffff53086cb in QObject::event(QEvent*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#16 0x00007ffff616bd42 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Widgets.so.5
#17 0x00007ffff7b22e5e in KisApplication::notify(QObject*, QEvent*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libkritaui.so.20
#18 0x00007ffff52db198 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#19 0x00007ffff52de8b1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#20 0x00007ffff5337857 in ?? () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#21 0x00007ffff2a82d3b in g_main_context_dispatch () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libglib-2.0.so.0
#22 0x00007ffff2ad82b8 in ?? () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libglib-2.0.so.0
#23 0x00007ffff2a803e3 in g_main_context_iteration () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libglib-2.0.so.0
#24 0x00007ffff5336f0a in QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) ()
   from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#25 0x00007ffff52d9b3b in QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#26 0x00007ffff52e22f4 in QCoreApplication::exec() () from /tmp/.mount_krita-AcilJH/usr/bin/../lib/libQt5Core.so.5
#27 0x000055555555db33 in main ()
(gdb)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2475856</commentid>
    <comment_count>1</comment_count>
    <who name="Freya Lupen">penguinflyer2222</who>
    <bug_when>2025-12-10 14:46:39 +0000</bug_when>
    <thetext>I can&apos;t reproduce this from those specific steps, that backtrace just seems to randomly happen sometimes when I close Krita with a document containing text after the text-in-shape MR!2432 was merged.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2485503</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2026-01-16 15:14:39 +0000</bug_when>
    <thetext>I&apos;m afraid I cannot reproduce the issue here</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2488990</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2026-01-27 16:32:44 +0000</bug_when>
    <thetext>Git commit 4cc73f716bac902fda022c2415b9f211709d4fa1 by Dmitry Kazakov, on behalf of Luna Lovecraft.
Committed on 27/01/2026 at 16:29.
Pushed by dkazakov into branch &apos;master&apos;.

Fix crash when deleting vector layers

This fix crashes two issues:

Crash 1

1) Create a vector layer
2) Don&apos;t manipulate with it in any form (important to keep the shape
   manager not initialized)
3) Remove this vector layer
4) Close the document without saving -&gt; crash

Crash 2

1) Create a vector layer
2) Add a rectangle shape
3) Add some text inside the rectangle shape
4) Enter the &quot;text contour editing mode&quot;
5) Remove the vector layer
6) Close the document without saving -&gt; crash

M  +2    -1    libs/ui/canvas/kis_canvas2.cpp

https://invent.kde.org/graphics/krita/-/commit/4cc73f716bac902fda022c2415b9f211709d4fa1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>