Bug 409617

Summary: Krita goes unresponsive while editing text
Product: [Applications] krita Reporter: Annabel <Annabeltalts>
Component: Tool/TextAssignee: vanyossi <ghevan>
Status: RESOLVED FIXED    
Severity: crash CC: adrian.dummermuth, dimula73, dinarnorlund, ghevan, halla, info, kapyia.art, smslcurtis
Priority: NOR    
Version: 4.2.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: Original Krita file (immediately after the crash)

Description Annabel 2019-07-08 12:44:10 UTC
Created attachment 121383 [details]
Original Krita file (immediately after the crash)

SUMMARY
The Krita window and Edit Text window sometimes go unresponsive when I click save in the text editing window. It seems to happen randomly - happened twice in a 1.5 hour time frame.
Waiting does not help, I am forced to close the program, losing all unsaved progress. (No crash log)
Error reports:
08-Jul-19 11:12 AM	Windows Error Reporting	Fault bucket 1500275099276996261, type 5&#x000d;&#x000a;Event Name: AppHangB1&#x000d;&#x000a;Response: Not available&#x000d;&#x000a;Cab Id: 0&#x000d;&#x000a;&#x000d;&#x000a;Problem signature:&#x000d;&#x000a;P1: krita.exe&#x000d;&#x000a;P2: 0.0.0.0&#x000d;&#x000a;P3: 00000000&#x000d;&#x000a;P4: 5157&#x000d;&#x000a;P5: 134217728&#x000d;&#x000a;P6: &#x000d;&#x000a;P7: &#x000d;&#x000a;P8: &#x000d;&#x000a;P9: &#x000d;&#x000a;P10: &#x000d;&#x000a;&#x000d;&#x000a;Attached files:&#x000d;&#x000a;\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8B19.tmp.WERInternalMetadata.xml&#x000d;&#x000a;\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8B3A.tmp.xml&#x000d;&#x000a;\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8B48.tmp.csv&#x000d;&#x000a;\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8B68.tmp.txt&#x000d;&#x000a;\\?\C:\Users\PETR\AppData\Local\Temp\WER7DB1.tmp.appcompat.txt&#x000d;&#x000a;&#x000d;&#x000a;These files may be available here:&#x000d;&#x000a;C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppHang_krita.exe_ef92f8617cbfec1d52e94fdf1947ca5474f844_98145fca_1fa38e1a&#x000d;&#x000a;&#x000d;&#x000a;Analysis symbol: &#x000d;&#x000a;Rechecking for solution: 0&#x000d;&#x000a;Report Id: 391d1334-8d38-4159-b1c1-034dc403cecb&#x000d;&#x000a;Report Status: 268435456&#x000d;&#x000a;Hashed bucket: 53774b54d204303164d20c4105c4eea5&#x000d;&#x000a;Cab Guid: 0

08-Jul-19 11:12 AM	Application Hang	The program krita.exe version 0.0.0.0 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance control panel.&#x000d;&#x000a; Process ID: 3330&#x000d;&#x000a; Start Time: 01d535777424c9d4&#x000d;&#x000a; Termination Time: 12&#x000d;&#x000a; Application Path: D:\Krita (x64)\bin\krita.exe&#x000d;&#x000a; Report Id: 391d1334-8d38-4159-b1c1-034dc403cecb&#x000d;&#x000a; Faulting package full name: &#x000d;&#x000a; Faulting package-relative application ID: &#x000d;&#x000a;

Same reports at 12:31
I have two displays

STEPS TO REPRODUCE
1. I start editing a text
2. I click "save"
3. Not responding

OBSERVED RESULT - Program goes unresponsive

I was working on a small image - 3 layers, Tell us what kind of image you were working on: the size, the resolution, the color model and channel depth.


If at all possible, attach your original Krita file (the one that ends in .kra) to the bug report, or if it’s too big, add a link for download. If you do that, make sure the file will be there for years to come: do not remove it.

EXPECTED RESULT - text changes save normally, program does not go unresponsive


SOFTWARE/OS VERSIONS
Windows: 


ADDITIONAL INFORMATION
Comment 1 Annabel 2019-07-08 12:50:03 UTC
Sorry, accidentally posted before finished writing

Small image - 3 layers, 1600x1200 reso, 19.4 MiB, RGB/Alpha model, 8 bit integer/channel depth.

OS version: Windows 10 home Version 10.0.17134 Build 17134
Comment 2 Annabel 2019-07-08 21:12:03 UTC
I recreated the crash with steps like this:
1. I started writing text
2. Changed font to MV boli, size 7, center alignment
3. click save
4. Not responding
Comment 3 Annabel 2019-07-08 21:42:43 UTC
(In reply to Annabel from comment #2)
> I recreated the crash with steps like this:
> 1. I started writing text
> 2. Changed font to MV boli, size 7, center alignment
> 3. click save
> 4. Not responding

After continuous trying, the problem seems to be the text I write - pressing shift enter. Using just enter does not result with program not responding
Comment 4 Kapyia 2019-07-09 14:30:11 UTC
I'm able to reproduce this bug on my Windows system, independent of font, size, alignment, etc.. Krita will crash if the first new-line is the "Shift+Return" variant. However, if the first new-line is a regular "Return" one the software doesn't seem to crash for me, no matter what you use afterwards. 

I noticed that a regular "Return" new-line will start a new paragraph in the SVG-source, whereas the "Shift+Return" variant just adds a new-line to the SVG-source itself.
Comment 5 Ralek Kolemios 2019-07-24 23:31:40 UTC
I am able to reproduce this issue as well, Windows 10 Krita 4.2.3. Krita has crashed on me multiple times in the past hour when saving text containing shift+enter returns.
Comment 6 vanyossi 2019-08-23 19:38:53 UTC
The issue occurs in KoSvgTextShape.cpp:354

textLength() does not advance as Shift + Enter is no a drawable Glyph. Just breaking the loop does not instantly fixes the issue as if causes a SAFE ASSERT later on.

Need some time to come up with a solution that doesn't break tabs also.
Comment 7 Halla Rempt 2019-08-27 15:11:02 UTC
*** Bug 410880 has been marked as a duplicate of this bug. ***
Comment 8 Halla Rempt 2019-09-02 07:51:47 UTC
*** Bug 411476 has been marked as a duplicate of this bug. ***
Comment 9 Halla Rempt 2019-09-02 09:00:15 UTC
*** Bug 410402 has been marked as a duplicate of this bug. ***
Comment 10 Halla Rempt 2019-09-02 09:01:10 UTC
Okay, I hadn't seen this bug report when I posted a MR for a possible solution to  https://bugs.kde.org/show_bug.cgi?id=410402 -- Ivan, given the number of duplicates, I think that this bug should be your first priority.
Comment 11 Dmitry Kazakov 2019-09-10 11:30:28 UTC
The crash should be fixed after this merge request is merged:
https://invent.kde.org/kde/krita/merge_requests/128
Comment 12 Dmitry Kazakov 2019-09-13 09:56:44 UTC
The bug is fixed in 
https://invent.kde.org/kde/krita/commit/535ca1fc6fde92003258c2dd861e05cce3bf8004