Bug 410402 - File won't open in new version of Krita due triple period unicode character.
Summary: File won't open in new version of Krita due triple period unicode character.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.2.3
Platform: Other Other
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 411829 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-30 14:02 UTC by dinarnorlund
Modified: 2019-09-12 04:59 UTC (History)
3 users (show)

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


Attachments
Comic page that causes Krita to crash, link to drive download (82 bytes, text/plain)
2019-07-30 14:06 UTC, dinarnorlund
Details
the SVG of the shapelayer that refuses to open. (1.67 KB, image/svg+xml)
2019-07-30 14:18 UTC, wolthera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dinarnorlund 2019-07-30 14:02:17 UTC
SUMMARY

One of my comic pages hadn't been opened since April. When I tried opening it through the comic manager or just normally today, it caused Krita to crash. This seems to be the problem with two of my files so far, though I haven't tested all the pages yet. I expect a few more might be acting similarly. 

I tried to open the file on my MacBook that has the older version of Krita installed: 4.1.7 and the file is behaving normally. I did try and reinstall Krita 4.2.0 on the PC, but the problem is still the same. Same with the newest update of Krita as well 4.2.3 So I suspect it is the new version of Krita that's being weird.

Anyway, the fact that I can open it on my Mac helps me and I shouldn't have any problems working on it there, but if this can be fixed sooner rather than later it would be amazing. I have attached one of the files that is making Krita crash so you can test it.

STEPS TO REPRODUCE
1. Open file

OBSERVED RESULT
Krita stops responding

EXPECTED RESULT
Krita Crashes

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 dinarnorlund 2019-07-30 14:06:09 UTC
Created attachment 121839 [details]
Comic page that causes Krita to crash, link to drive download

File too big to attach, see link to drive download
Comment 2 wolthera 2019-07-30 14:18:29 UTC
Created attachment 121840 [details]
the SVG of the shapelayer that refuses to open.

So, after looking into the file, there was only one layer which was different from the rest: the text vector layer. Removing this layer from maindoc.xml and repacking led to the kra file being possible to be opened. Trying to open the text svg seperately leads to Krita freezing up again.

So, we need to figure out what it is about this svg that makes Krita 4.2 unhappy, but Krita 4.1.7 is fine with.
Comment 3 wolthera 2019-07-30 14:29:56 UTC
I've found the culprit, it's '…', or a triple period unicode character.
Comment 4 Halla Rempt 2019-09-02 08:10:51 UTC
Git commit fa5d8d30db3421bf022f94f53b96b34b868f8492 by Boudewijn Rempt.
Committed on 02/09/2019 at 08:09.
Pushed by rempt into branch 'rempt/bug-410402'.

Do not hang on loading text containing triple-dot

Break the loop: if adding an offset to the number of columns doesn't
increase the line length, we break out of the loop to avoid an
infinite loop on loading some files.

M  +4    -0    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/kde/krita/commit/fa5d8d30db3421bf022f94f53b96b34b868f8492
Comment 5 Halla Rempt 2019-09-02 09:00:15 UTC

*** This bug has been marked as a duplicate of bug 409617 ***
Comment 6 vanyossi 2019-09-04 23:38:19 UTC
Git commit cd3313794491fc6409e0a9db31d2813920c7192b by Ivan Yossi.
Committed on 04/09/2019 at 23:36.
Pushed by ivany into branch 'rempt/bug-410402'.

Fix hang when utf line break is used

Shift + Enter creates an utf break character which breaks
the lenght calculation. Also added a reptition flag to avoid
any other hang if there is a strange symbol.

M  +1    -1    libs/flake/text/KoSvgTextChunkShape.cpp
M  +9    -2    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/kde/krita/commit/cd3313794491fc6409e0a9db31d2813920c7192b
Comment 7 vanyossi 2019-09-11 23:28:44 UTC
Git commit 535ca1fc6fde92003258c2dd861e05cce3bf8004 by Ivan Yossi.
Committed on 11/09/2019 at 23:27.
Pushed by ivany into branch 'master'.

Fix hang when utf line break is used

Break the loop: if adding an offset to the number of columns doesn't
increase the line length, we break out of the loop to avoid an
infinite loop on loading some files.

Shift + Enter creates an utf break character which breaks
the lenght calculation. Also added a reptition flag to avoid
any other hang if there is a strange symbol.

ref:https://invent.kde.org/kde/krita/merge_requests/128

M  +1    -1    libs/flake/text/KoSvgTextChunkShape.cpp
M  +11   -0    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/kde/krita/commit/535ca1fc6fde92003258c2dd861e05cce3bf8004
Comment 8 vanyossi 2019-09-11 23:31:28 UTC
*** Bug 411829 has been marked as a duplicate of this bug. ***
Comment 9 vanyossi 2019-09-12 04:59:59 UTC
Git commit 93e737e74eb930e6384999e2c350d7803d844567 by Ivan Yossi.
Committed on 12/09/2019 at 04:59.
Pushed by ivany into branch 'krita/4.2'.

Fix hang when utf line break is used

Break the loop: if adding an offset to the number of columns doesn't
increase the line length, we break out of the loop to avoid an
infinite loop on loading some files.

Shift + Enter creates an utf break character which breaks
the lenght calculation. Also added a reptition flag to avoid
any other hang if there is a strange symbol.

ref:https://invent.kde.org/kde/krita/merge_requests/128


(cherry picked from commit 535ca1fc6fde92003258c2dd861e05cce3bf8004)

M  +1    -1    libs/flake/text/KoSvgTextChunkShape.cpp
M  +11   -0    libs/flake/text/KoSvgTextShape.cpp

https://invent.kde.org/kde/krita/commit/93e737e74eb930e6384999e2c350d7803d844567