-
Notifications
You must be signed in to change notification settings - Fork 466
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 bindings segfault when deallocating an instance of FGFDMExec when multiple are instantiated in memory #201
Comments
Yes, this is a known issue that is due to the usage of a Lines 611 to 613 in 0ec1cc8
For now, this can be ignored unless this is an obstacle to your application. I will fix this issue later. |
Copy, will work around for now using multiprocessing. If I end up needing it for the application I can help with the fix. |
The final objective is to remove the static member of FGLocation for ground callback (see issue #201).
The final objective is to remove the static member of FGLocation for ground callback (see issue #201).
I'm currently working with a multi-vehicle simulation engine that utilizes multi-threading to efficiently run simulations of thousand of flying vehicles for robotics applications. The multi-threading is important especially when running large batch simulations while doing machine learning. We're using JSBSim as our vehicle simulation back end. This bug is a huge problem for us, since it causes segfaults whenever we have vehicles that are destructed (which happens often during our game simulations, when vehicles are destroyed for various reasons and their resources are destructed). Currently we have to maintain a patch for JSBSim that removes this bug, but it's annoying to have to keep it around. Is there any plan to fix this in the near future? We want to get back onto mainline master for JSBSim but we can't do that until this bug is fixed. Thanks. |
I also stumbled into the "no multithreading" issue recently, when setting up a machine learning environment using JSBSim based on https://github.com/Gor-Ren/gym-jsbsim At least, I was warned, that mutlithreading won't work for the moment. It would be a huge win for machine learning applications to have the possibility to instantiate more than one instance of @crichardson332 , @venabled : Looks like you have a workaround/patch for this multithreading issue for JSBSim. Can you please make this available with some words of explanation. this would be a big help for me. Regards, Felix |
Thanks all for the report. |
@venabled , @crichardson332 and @opt12 The Python wheel packages are available in the 2019 rolling release section for Windows 64bits and Linux 64bits. They may be a bit rough around the edges at the moment so let me know if you encounter any problems. |
@bcoconni Big Kudos to Bertrand! Works for me. |
@venabled @crichardson332 @opt12 |
Well, I guess this ticket is closed now. |
I haven't had a chance to try the fix yet and won't be able to for a few weeks - we do a lot of flight testing and can't update to the newest commit for a bit. But if we encounter any issues when we do, I will make tickets for it. Thanks! |
FGFDMExec must depend on something that has only a single instance in memory. When instantiating two exec classes, deallocation of the first works, then the second segfaults.
Example output:
Validated on python3.6 and 3.7 with master, and on the 1.0rc, both built from source and using the module provided in releases. Validated on arch-linux (amd-64), (Anaconda python 3.6, 3.7, and system Python 3.7), and macOS Mojave (Anaconda Python 3.6 and 3.7)
The text was updated successfully, but these errors were encountered: