godot: Godot 3.2.4rc3 mono crashes on exit with specific combination of packed scene and dynamic font
Godot version:
v3.2.4.rc3.mono.official
OS/device including version: MacOS 11.2.2
OpenGL ES 3.0 Renderer: Intel® Iris™ Plus Graphics 650 OpenGL ES Batching: ON
Issue description:
Sorry the title is such a mess. I couldn’t figure out a way to summarize this succinctly.
Godot segfaults on exit if the following sequence occurs:
- Load a scene with a monoscript containing an exported
PackedScenevariable - Change scenes to that packed scene.
- If the packed scene uses a control with a
DynamicFontGodot will now segfault when quitting producing a traceback such as the following.
Concretely if I have a button with this script
using Godot;
public class AButton : Button
{
[Export] private PackedScene Other;
public override void _Pressed()
{
base._Pressed();
GetTree().ChangeSceneTo(Other);
}
}
and the scene Other contains a dynamic font, then the game crashes on exit if the scene Other has been loaded.
Steps to reproduce: The conditions for this are somewhat specific but I’ve been able to reproduce them reliably with the following.
- In the example project below. Run the scene
AScene.tscn - Click the button
- Quit At this point the game crashes on exit and dumps a stacktrace.
Note that no crash occurs if:
- The second scene isn’t loaded
- The second scene isn’t loaded from the packed scene variable
- The second scene does not use a
DynamicFont
Minimal reproduction project:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (19 by maintainers)
For Godot debugger we can add
get/set_thread_name()andMap<ID, String>to make it even more readable.In case it’s useful, here’s my patch, which fixes crash on macOS (I have not tested it on any other platforms).
Edit: Added default
std::thread::id()values instead of zeros.