godot: Crash when Thread Model is set to Multi-Threaded
Godot version
Godot Engine v4.0.alpha9.official.fc18891db
System information
5.15.0-33-generic #34-Ubuntu SMP Wed May 18 13:34:26 UTC 2022 x86_64 5700XT
Issue description
Projects run with Godot 4.0 alpha 9 instantly crash when Rendering>Driver>Threads>Thread Model is set to Multi-Threaded. The same project ran fine in alpha 8. Below is the output log.
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.alpha9.official (fc18891dbceace03c3867ac26c15b79cfbc673df)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f80a1d1d520] (??:0)
[2] /home/user/Downloads/Godot_v4.0-alpha9_linux.64() [0xdc77a7] (??:0)
[3] /home/user/Downloads/Godot_v4.0-alpha9_linux.64() [0x37459a0] (??:0)
[4] /home/user/Downloads/Godot_v4.0-alpha9_linux.64() [0xdaf1ed] (??:0)
[5] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f80a1d04d90] (??:0)
[6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f80a1d04e40] (??:0)
[7] /home/user/Downloads/Godot_v4.0-alpha9_linux.64() [0xdc3aae] (??:0)
-- END OF BACKTRACE --
Steps to reproduce
Set Thread Model to Multi-Threaded and run a project. Affects existing project, as well as new projects with no other changes made.
Minimal reproduction project
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 18 (11 by maintainers)
I was frustrated I can’t repro the GPU errors, so this one out, randomly, which grabbed my attention (I’m on latest master 262d1eaa631e9cefc3f6f09845579cef2af37576).
The problem is that it ends up in an infinite recursion:
multimesh_set_buffer ends up calling flush_if_pending, which ends up calling multimesh_set_buffer (and tries to flush again).
The value of
command_mem.size()
is 56Update
So it appears that
CommandQueueMT::_flush
starts executing all commands, which ends up callingCPUParticles3D::_update_render_thread
_update_render_thread calls
RS::get_singleton()->multimesh_set_buffer
.However despite being a virtual function, it doesn’t seem to be overriden by anything except this:
FUNC2(multimesh_set_buffer, RID, const Vector<float> &)
Which is a macro that generates the following body:
Can’t reproduce with 4.3dev6, but can with 4.3dev5, seems like fixed by #90268