godot icon indicating copy to clipboard operation
godot copied to clipboard

Crashes when Importing multiple SVG files at once or multicolored SVG files

Open kcfresh53 opened this issue 1 year ago • 2 comments

Godot version

4.0

System information

Windows 11 22H2, GPU: Nvidia Mx330, CPU: intel core i5 10th gen, 12GB RAM

Issue description

When importing multiple SVG files at once or importing a multicolored SVG file, Godot 4.0 crashes. The problem then goes away when the project is reopened for multiple SVG files, but it still crashes when dealing with multicolored SVGs.

Steps to reproduce

Add a minimum of 30 monochrome SVG icons in a new project directory or one multicolored SVG file (e.g. Instagram logo) to recreate the issue.

Minimal reproduction project

"N/A"

kcfresh53 avatar Mar 10 '23 13:03 kcfresh53

Please attach a reproduction project with SVG files which trigger the crash. This is highly dependent on the content of the files you're using so we can't necessarily reproduce it without them.

akien-mga avatar Mar 10 '23 13:03 akien-mga

Submission doc.zip icons8-instagram instagram-round-color-icon

Here. I was able to reproduce the problem with a different set of Icons as well.

kcfresh53 avatar Mar 10 '23 13:03 kcfresh53

I could not reproduce the crash. Removed .import files and .godot folder as well.. still cannot reproduce it.

stmSi avatar Mar 15 '23 11:03 stmSi

Tested with current godot tip. All images in your zip folder and the 48x48px one you posted directly have no problems at all. The gigantic image is 88x88 meters (viewBox="0 0 333333 333333") takes a lot of time and memory (1GB). If you wait long enough, Godot doesn't crash...

WARNING: ImageLoaderSVG: Target canvas dimensions 333333×333333 (with scale 1.00) 
exceed the max supported dimensions 16384×16384. 
The target canvas will be scaled down.
     at: create_image_from_utf8_buffer (modules/svg/image_loader_svg.cpp:87)

capnm avatar Apr 05 '23 23:04 capnm

I usually leave Godot running without clicking on anything and it still crashes. I tested it on a different computer with no problems but when trying a third computer, the problem persisted. The two computers that had the issue had a minimum of 12GB of ram, the one without issues uses 32GB of ram. I would assume it may have to do with memory but I am not sure.

kcfresh53 avatar Apr 10 '23 11:04 kcfresh53

Try enabling Editor Settings>Interface/Editor/Single Window Mode, there are issues with external windows or look for windows crash issues. It doesn't look like SVG related to me. Under Linux it works fine.

capnm avatar Apr 10 '23 11:04 capnm

This does look like it is simply just too much to handle. Rasterizing such a large image requires quite a lot of memory. I'm not sure if there is a practical need for this, but I doubt it. So I'm going to close this issue.

YuriSizov avatar Jun 23 '23 18:06 YuriSizov