Bug 442205 - A .kra file with an enormous vector selection will seem to hang on loading
Summary: A .kra file with an enormous vector selection will seem to hang on loading
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 5.0.0-beta1
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-09 07:12 UTC by rebuilderster
Modified: 2022-08-11 10:49 UTC (History)
1 user (show)

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


Attachments
Example .KRA file created following the steps described, will cause Krita to hang when opened. (2.02 MB, application/x-krita)
2021-09-09 08:26 UTC, rebuilderster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rebuilderster 2021-09-09 07:12:15 UTC
SUMMARY
if a selection is active when saving to .kra, the resulting .kra file can not be opened, but Krita will hang with 1 cpu thread at 100%.

I've provided the precise steps to reproduce, I'm not sure if all are needed.

STEPS TO REPRODUCE
1. Create a new file, at 4000x3000 pixels
2. create a new layer, draw something on it.
3. create a rectangular selection that partially goes outside the canvas bounds (don't know if this is important, but it's what I did)
4. save the file as .kra and close it.
5. reopen the file.

OBSERVED RESULT
Krita hangs.
Comment 1 rebuilderster 2021-09-09 08:26:42 UTC
Created attachment 141415 [details]
Example .KRA file created following the steps described, will cause Krita to hang when opened.
Comment 2 Halla Rempt 2021-09-09 08:34:32 UTC
With your file, I can reproduce the hang, but I cannot create such a file myself. Are you using the appimage, or distribution packages?
Comment 3 Halla Rempt 2021-09-09 08:57:10 UTC
For some reason, the selection mask is enormous:

<svg xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:krita="http://krita.org/namespaces/svg/krita"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    width="288000pt"
    height="216000pt"
    viewBox="0 0 288000 216000">
<defs/>
<rect id="shape0" transform="translate(145152, 47520)" fill="none" width="145584" height="95472"/>
</svg>
Comment 4 Halla Rempt 2021-09-09 09:04:03 UTC
Krita doesn't actually hang, it just tries to render that vector shape. Given that the resolution of this image is 1dpi, that will not go well.
Comment 5 Halla Rempt 2022-08-11 10:49:57 UTC
I'm not sure what we changed in the meantime... But the file now loads instantly!