Bug 518305 - Krita crashes selecting text tool after performing specific set of actions
Summary: Krita crashes selecting text tool after performing specific set of actions
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (other bugs)
Version First Reported In: 5.3.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-29 20:08 UTC by vurentjie
Modified: 2026-04-02 08:34 UTC (History)
1 user (show)

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


Attachments
Screen recording of steps to crash (3.18 MB, video/mp4)
2026-03-29 20:08 UTC, vurentjie
Details
Screen cast with repro of error - version 2 (1.85 MB, video/mp4)
2026-03-29 20:28 UTC, vurentjie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vurentjie 2026-03-29 20:08:02 UTC
Created attachment 191123 [details]
Screen recording of steps to crash

SUMMARY
After performing a specific set of actions, I can repeatedly crash Krita. 
Download latest 5.3.0 AppImage and start from a clean configuration.

STEPS TO REPRODUCE
1. Open Krita
2. Open a document from the filesystem
3. Run the following script in the scripter to add a second view of the document from step 2:

     ki = Krita.instance()
     win = ki.activeWindow()
     doc = win.activeView().document()
     win.addView(doc)

4. Close the first document (from step 2) by click close on the tab 
5. Click on the Text Tool icon the Toolbox docker (this triggers the crash)


OBSERVED RESULT
Krita crashes. 

EXPECTED RESULT
Krita does not crash.


SOFTWARE/OS VERSIONS
Krita

 Version: 5.3.0 (git 148ce5c)
 Hidpi: true

Qt

  Version (compiled): 5.15.7
  Version (loaded): 5.15.7

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 6.17.0-19-generic
  Pretty Productname: Ubuntu 24.04.4 LTS
  Product Type: ubuntu
  Product Version: 24.04
  Desktop: ubuntu:GNOME
  Appimage build: Yes

ADDITIONAL INFORMATION
I am attaching a screen recording of the steps above.
Comment 1 vurentjie 2026-03-29 20:25:18 UTC
I just realized the bug can be reproduced without the scripter, just by opening a second view, with these steps:

STEPS TO REPRODUCE
1. Open Krita
2. Open a document from the filesystem
3. Click Window > New View > Select Document from step 2.
4. Close the first view of the document (from step 2) by click close on the tab 
5. Click on the Text Tool icon the Toolbox docker (this triggers the crash)

I will add a second screen recording for these steps
Comment 2 vurentjie 2026-03-29 20:28:28 UTC
Created attachment 191124 [details]
Screen cast with repro of error - version 2
Comment 3 vurentjie 2026-03-29 20:54:56 UTC
This bug also occurs on Windows and MacOS
Comment 4 vurentjie 2026-04-01 20:09:19 UTC
I created a merge request with a possible fix for this here: https://invent.kde.org/graphics/krita/-/merge_requests/2738
Comment 5 Dmitry Kazakov 2026-04-02 08:33:44 UTC
Git commit a4350e5c4669da5fb6c720301d9f52f5d7f6280f by Dmitry Kazakov, on behalf of Gregg Jansen van Vuren.
Committed on 02/04/2026 at 08:33.
Pushed by dkazakov into branch 'master'.

Fix crashes when selecting text tool after some actions

It turned to just be a few missing null checks.

M  +7    -4    plugins/tools/svgtexttool/SvgTextTool.cpp

https://invent.kde.org/graphics/krita/-/commit/a4350e5c4669da5fb6c720301d9f52f5d7f6280f
Comment 6 Dmitry Kazakov 2026-04-02 08:34:21 UTC
Git commit 56c5815807686e691fa6555c323eab968951a2b8 by Dmitry Kazakov.
Committed on 02/04/2026 at 08:34.
Pushed by dkazakov into branch 'krita/6.0'.

Fix crashes when selecting text tool after some actions

It turned to just be a few missing null checks.


(cherry picked from commit a4350e5c4669da5fb6c720301d9f52f5d7f6280f)

e80a43d0 fix-518305

Co-authored-by: Gregg Jansen van Vuren <gregg.vuren@gmail.com>

M  +7    -4    plugins/tools/svgtexttool/SvgTextTool.cpp

https://invent.kde.org/graphics/krita/-/commit/56c5815807686e691fa6555c323eab968951a2b8