pybind11
pybind11 copied to clipboard
[BUG]: crash importing again same module
Required prerequisites
- [X] Make sure you've read the documentation. Your issue may be addressed there.
- [X] Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- [X] Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
1.12.0
Problem description
Restarting an embedded interpreter gives crash when importing a module the second time.
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in test.exe.
Some modules, like 'sys' or 'os', work fine.
Reproducible example code
int main() {
py::initialize_interpreter();
py::module_::import("numpy"); //--> it works fine with modules like 'sys', 'os'.
py::finalize_interpreter();
py::initialize_interpreter();
py::module_::import("numpy"); //--> crash here
py::finalize_interpreter();
return 0;
}
Is this a regression? Put the last known working version here if it is.
Not aware if this is a regression