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

Python API segmentation fault #116

Open
ErikGartner opened this issue May 20, 2021 · 2 comments
Open

Python API segmentation fault #116

ErikGartner opened this issue May 20, 2021 · 2 comments

Comments

@ErikGartner
Copy link
Contributor

ErikGartner commented May 20, 2021

Using world.get_mb_constraint_solver() and world.set_mb_constraint_solver() will lead to segmentation fault due to double free from both world's destructor and PyBind11's destructor.

One solution is to remove them from the Python API until they are made safe. I can make a PR if this is a desired fix.

@erwincoumans
Copy link
Owner

Thanks for the report. Indeed, mixing memory allocations from Python as well as in C++ will easily lead to issues when using PyBind11. I'd like to remove the allocations in world and other locations, but it may require a bit of refactoring (breaking the API). Let's leave it open for now, until it is sorted.

@erwincoumans
Copy link
Owner

erwincoumans commented May 21, 2021

One quick way would be to have the world a member of the default constraint solver, with a pointer to it, so it doesn't need to be deleted. Then we can get rid of the new in constructor and delete in the destructor. So the allocation of a alternative constraint solver happens externally.

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

2 participants