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

ModelDerivatives::Compute makes thread-unsafe call to mj_transitionFD #335

Open
nimrod-gileadi opened this issue Jul 31, 2024 · 1 comment

Comments

@nimrod-gileadi
Copy link
Collaborator

Here:

multiple threads are calling mjd_transitionFD on the same mjData instance. Unfortunately, mjd_transitionFD takes a non-const mjData*, 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.

@nimrod-gileadi
Copy link
Collaborator Author

Actually, every thread should have its own mjData, so I may have misdiagnosed the issue.

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

No branches or pull requests

1 participant