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

Sporadic threading issues in the physics server #85217

Open
YuriSizov opened this issue Nov 22, 2023 · 1 comment
Open

Sporadic threading issues in the physics server #85217

YuriSizov opened this issue Nov 22, 2023 · 1 comment

Comments

@YuriSizov
Copy link
Contributor

YuriSizov commented Nov 22, 2023

Godot version

4.2.rc (a34814b), previous commits as well

System information

Windows 10.0.22621 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3070 Ti Laptop GPU (NVIDIA; 31.0.15.3742) - 12th Gen Intel(R) Core(TM) i7-12700H (20 Threads)

Issue description

I'm not entirely sure about the nature of this bug, several times during my testing of multiple different projects and editor builds I had multithreading related errors from the physics server sporadically appear.

For example, you can get this on startup:

ERROR: Adding children to a node inside the SceneTree is only allowed from the main thread. Use call_deferred("add_child",node).
   at: (scene\main\node.cpp:1406)
Adding children to a node inside the SceneTree is only allowed from the main thread. Use call_deferred("add_child",node).
ERROR: Condition "!is_inside_tree()" is true.
   at: Window::popup_centered (scene\main\window.cpp:1642)
scene\main\window.cpp:1642 - Condition "!is_inside_tree()" is true.
ERROR: Condition "main_thread != Thread::get_caller_id()" is true. Returning: nullptr
   at: PhysicsServer2DWrapMT::space_get_direct_state (C:\Projects\godot-engine\master\servers\physics_server_2d_wrap_mt.h:113)
C:\Projects\godot-engine\master\servers\physics_server_2d_wrap_mt.h:113 - Condition "main_thread != Thread::get_caller_id()" is true. Returning: nullptr

One time it was followed by a barrage of errors with a repeating spam of the same error message (might be unrelated, but I'm none the wiser):

godot windows editor dev x86_64_2023-11-20_16-18-10

I also had a crash on exit related to the physics server, but unfortunately I didn't capture the stack trace.

Steps to reproduce

Undetermined at the time.

Minimal reproduction project

Doesn't happen with a specific project, doesn't happen reliably at all.

Can't say if these are relevant, but you can start with the projects linked in #84171 and #85201

@YuriSizov
Copy link
Contributor Author

I also had a crash on exit related to the physics server, but unfortunately I didn't capture the stack trace.

Okay, maybe not a crash. But I seem to hit a dev assert with the XR template project:

godot.windows.editor.dev.x86_64.exe!SelfList<GodotCollisionObject3D>::List::~List() Line 165 (c:\Projects\godot-engine\master\core\templates\self_list.h:165)
godot.windows.editor.dev.x86_64.exe!GodotPhysicsServer3D::~GodotPhysicsServer3D() Line 382 (c:\Projects\godot-engine\master\servers\physics_3d\godot_physics_server_3d.h:382)
godot.windows.editor.dev.x86_64.exe!GodotPhysicsServer3D::`scalar deleting destructor'(unsigned int) (Unknown Source:0)
godot.windows.editor.dev.x86_64.exe!memdelete<PhysicsServer3D>(PhysicsServer3D * p_class) Line 112 (c:\Projects\godot-engine\master\core\os\memory.h:112)
godot.windows.editor.dev.x86_64.exe!PhysicsServer3DWrapMT::~PhysicsServer3DWrapMT() Line 137 (c:\Projects\godot-engine\master\servers\physics_server_3d_wrap_mt.cpp:137)
godot.windows.editor.dev.x86_64.exe!PhysicsServer3DWrapMT::`scalar deleting destructor'(unsigned int) (Unknown Source:0)
godot.windows.editor.dev.x86_64.exe!memdelete<PhysicsServer3D>(PhysicsServer3D * p_class) Line 112 (c:\Projects\godot-engine\master\core\os\memory.h:112)
godot.windows.editor.dev.x86_64.exe!finalize_physics() Line 316 (c:\Projects\godot-engine\master\main\main.cpp:316)
godot.windows.editor.dev.x86_64.exe!Main::cleanup(bool p_force) Line 3819 (c:\Projects\godot-engine\master\main\main.cpp:3819)
godot.windows.editor.dev.x86_64.exe!widechar_main(int argc, wchar_t * * argv) Line 184 (c:\Projects\godot-engine\master\platform\windows\godot_windows.cpp:184)
godot.windows.editor.dev.x86_64.exe!_main() Line 204 (c:\Projects\godot-engine\master\platform\windows\godot_windows.cpp:204)
godot.windows.editor.dev.x86_64.exe!main(int argc, char * * argv) Line 218 (c:\Projects\godot-engine\master\platform\windows\godot_windows.cpp:218)
godot.windows.editor.dev.x86_64.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 232 (c:\Projects\godot-engine\master\platform\windows\godot_windows.cpp:232)
[Inline Frame] godot.windows.editor.dev.x86_64.exe!invoke_main() Line 102 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:102)
godot.windows.editor.dev.x86_64.exe!__scrt_common_main_seh() Line 288 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
kernel32.dll!00007ff81140257d() (Unknown Source:0)
ntdll.dll!00007ff81206aa58() (Unknown Source:0)

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

No branches or pull requests

1 participant