Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing SVG's in 4.3.dev with commit 73589f6 is crashing #87788

Closed
RevoluPowered opened this issue Jan 31, 2024 · 6 comments · Fixed by #88053
Closed

Importing SVG's in 4.3.dev with commit 73589f6 is crashing #87788

RevoluPowered opened this issue Jan 31, 2024 · 6 comments · Fixed by #88053

Comments

@RevoluPowered
Copy link
Contributor

RevoluPowered commented Jan 31, 2024

Tested versions

  • Reverting ThorVG: update from v0.12.1 to v0.12.3 #87612 resolves the crashing
  • Crash is not always present on windows but sometimes is
  • Linux could repro the crash each time booting the engine provided you nuke the .godot/ folder

System information

Linux - Fedora 38 - As up to date as possible

Issue description

When importing SVG files in multiple threads the engine crashes with a realloc() crash, I did try to workaround this but had the same crash
image

Steps to reproduce

  • Import a pool of SVG's (doesn't seem to matter the type)

Minimal reproduction project (MRP)

TESTPROJECTREPRO.zip

Images taken from another source, our project files are completely unrelated and they also crash.

@akien-mga
Copy link
Member

CC @capnm

@capnm
Copy link
Contributor

capnm commented Jan 31, 2024

Unfortunately I can't reproduce this myself, I even tested the PR importing a large amount of SVGs (debian 12, Vulkan API 1.3.230 - Forward+):
svg.zip

I have now run it again on the current tip 9adb7c7 and didn't see any issue
(with or without

[rendering]
driver/threads/thread_model=2

)

If anyone is able to reproduce this, perhaps could try to bisect the mentioned full ThorVG changelog.

The most likely would be thorvg/thorvg@cfb6a7e

@hermet
Copy link

hermet commented Feb 1, 2024

@RevoluPowered Hello, I'm wondering if you can use the thread sanitizer to catch any clues?

@Rubonnek
Copy link
Member

Rubonnek commented Feb 1, 2024

If the project is configured to use single threads (i.e. modify project.godot to include):

[editor]

import/use_multiple_threads=false

The SVGs import fine.

I'm able to reproduce the crash but I don't think it's related to ThorVG -- the crash happens at different places and due to double frees or some memory corruption. The root cause is most likely a race condition.

I stumbled upon a similar issue in #84364 with the same workaround, but it's far easier to reproduce the crash by importing these SVGs.

@akien-mga
Copy link
Member

@RevoluPowered @Rubonnek I couldn't reproduce this bug on Linux (Mageia 9), but I suspect it's related to #87962 (which I can reproduce) and should be fixed by #88053. Could you test to confirm?

@Rubonnek
Copy link
Member

Rubonnek commented Feb 7, 2024

@akien-mga can confirm -- I can't reproduce the crash described in this issue anymore easily with a build from 36e943b.

Edit: there's still some strange things going on under the hood due to the data race in EditorFileSystem::_reimport_thread but that problem merits its own issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants