multiple threads are calling mjd_transitionFD on the same mjData instance. Unfortunately, mjd_transitionFD takes a non-constmjData*, and performs MuJoCo stack allocations. Those allocations are not thread safe and will get mixed up between threads, so the resulting computation is likely nonsense.
This was discovered by running tests with ThreadSanitizer.
Here: https://github.com/google-deepmind/mujoco_mpc/blob/79db2bc0cc8e1ca4e96af0859718c265cdd22caf/mjpc/planners/model_derivatives.cc#L96
multiple threads are calling
mjd_transitionFD
on the samemjData
instance. Unfortunately,mjd_transitionFD
takes a non-constmjData*
, and performs MuJoCo stack allocations. Those allocations are not thread safe and will get mixed up between threads, so the resulting computation is likely nonsense.This was discovered by running tests with ThreadSanitizer.