Segmentation fault when loading the library if Godot is built with system-provided `harfbuzz`
If harfbuzz is system-provided instead of builtin when building Godot, loading GDMP library will cause immediate crash on said builds.
This is a problem because unlike official Godot editor that has everything builtin, distribution packagers might configure Godot to use system library for some modules (e.g. Arch, Flatpak), and users of these builds will run into such issue.
The crash is triggered by calling std::call_once during static initialization of the library.
Upstream issue: https://github.com/godotengine/godot/issues/91401
Known workarounds:
- Preload GDMP library with
LD_PRELOADenvironment variable. - Configure
icu4cthe same way asharfbuzzwhen building Godot, however writing to stdout from GDExtension will lead to segfault ificu4cis system-provided. (https://github.com/godotengine/godot/issues/100301)
Is this what the crash looks like in console?
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.stable.arch_linux
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x42200) [0x77ef27842200] (??:0)
-- END OF BACKTRACE --
===============================================================
Is this what the crash looks like in console?
================================================================ handle_crash: Program crashed with signal 11 Engine version: Godot Engine v4.3.stable.arch_linux Dumping the backtrace. Please include this when reporting the bug to the project developer. [1] /usr/lib/libc.so.6(+0x42200) [0x77ef27842200] (??:0) -- END OF BACKTRACE -- ===============================================================
Exactly, godot on Arch repository is configured to use harfbuzz from host system.