Closed j20001970 closed 3 weeks ago
After some investigation of the issue, I think I managed to narrow down the problem for a bit, and the bug report has been updated.
Honestly I do not know if this is Godot-side or Protobuf-side problem, and is way beyond my skill.
Update: I've once again narrow down the problem, and maybe found the actual root cause for real this time.
I'm curious that does Godot team receive notification when bug report is updated?
@j20001970 Everyone who watches the repository receives notification when someone comments.
I think this issue is related to GDExtension though it has no topic:gdextension
label, can you please update the label so this issue can have better visibility? Thank you.
Tested versions
Reproducible in recent Godot 4.x version (latest attempt is v4.4.dev.custom_build [1fc820876]) that uses system-provided
freetype, libpng, zlib, graphite, harfbuzz
libraries.System information
Godot v4.4.dev (1fc820876) - Freedesktop SDK 23.08 (Flatpak runtime) on Wayland - Wayland display driver, Single-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon RX 6650 XT (RADV NAVI23) - 12th Gen Intel(R) Core(TM) i5-12500 (12 threads)
The problem is found when developing GDExtension libraries on Linux, not sure if it also occur on other platforms.
Issue description
If Godot editor is using system-provided
freetype, libpng, zlib, graphite, harfbuzz
libraries instead of built-in, opening projects with GDExtension libraries that usesstd::call_once
during static initialization will crash the editor.While official Godot editor will work without problems as it has everything builtin, many custom builds including Linux distribution packages (for example Arch and Flathub) configure Godot to use these libraries as system-provided, resulting in said GDExtension libraries unusable in custom Godot editor builds.
However, if the GDExtension library is preloaded with
LD_PRELOAD
environment variable, the editor will open the project without any issues.Steps to reproduce
scons
.once called
will appear on stdout.freetype, libpng, zlib, graphite, harfbuzz
.Minimal reproduction project (MRP)
https://github.com/j20001970/godot_static_call_once_crash