QodotPlugin / qodot-plugin

(LEGACY) Quake .map support for Godot 3.x
MIT License
960 stars 70 forks source link

Intermittent crashes during generation #30

Closed Shfty closed 4 years ago

Shfty commented 4 years ago

This looks like it could be a race condition with assembling the geo tree structure, more research is needed into Godot's renderer threading modes.

Actually this looks like a more general-purpose error condition that may or may not crash. So far most occurrences have been with the renderer in single-safe mode, but having done some research it doesn't seem like it should be effected.

This is backed up by being able to generate ad_chapters semi-reliably on it, whereas I'd expect more consistent issues if multi-threading alongside a single-threaded renderer was fundamentally unsafe.

Error sample:

ERROR: body_attach_object_instance_id: Condition ' !body ' is true.
   At: modules/bullet/bullet_physics_server.cpp:574
ERROR: get: Condition ' !id_map.has(p_rid.get_data()) ' is true. returned: __null
   At: ./core/rid.h:154
ERROR: body_add_shape: Condition ' !body ' is true.
started thread job 0 / 4
   At: modules/bullet/bullet_physics_server.cpp:504
started thread job 0 / 4
ERROR: get: Condition ' !id_map.has(p_rid.get_data()) ' is true. returned: __null
   At: ./core/rid.h:154
ERROR: body_set_shape_transform: Condition ' !body ' is true.
   At: modules/bullet/bullet_physics_server.cpp:524
ERROR: get: Condition ' !id_map.has(p_rid.get_data()) ' is true. returned: __null
   At: ./core/rid.h:154
ERROR: body_set_shape_disabled: Condition ' !body ' is true.
   At: modules/bullet/bullet_physics_server.cpp:553

From the look of it, the physics server doesn't have a resource ID for whatever body is being attached. Must be an issue with one of the add_child calls during geo generation.

Shfty commented 4 years ago

Getting the feeling that this is a thread-safety issue to do with Resource objects.

Shfty commented 4 years ago

Fixed by the overhauled threading architecture.