-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Building python modules with static runtime #1618
Comments
I've hit related problem when loading 2 modules built with diffent runtimes (one dynamic and one static) with vc140. Exceptions thrown in C++ code are translated to Python exceptions through registered translators. The last loaded translator has same internals ID (since both modules are using same pybind version and release configuration) so it would pass generic exceptions to first registered module. In the process of rethrowing the exception in the other module the python process crashed with 0xC000005 error code. I could not reproduce the issue when both modules were built with vc142 compiler. |
Just found this issue, realizing that you guys already figured out what is happening in NVIDIA/TensorRT#2853 and #2898 almost 5 years ago :( |
Am I correct that if I use pybind11 to build python modules (pyd shared libraries on windows) with static runtime things can go horribly bad?
Details
It is not as obvious from docs, but while looking at the code I've figured out that: there is this shared
internals
object (seeget_internals()
). Which contains a lot of std containers. If my application would have say 2 pybind11 modules it could happen that allocation/deallocation will happen across dll boundaries? Moreover static runtimes can be different. Not to mention potential ABI incompatibility.Follow up question
If I make every pybind11 module with own internals (by having unique
PYBIND11_INTERNALS_ID
) what would the downsides be? What features will be lost?The text was updated successfully, but these errors were encountered: