[BUG]: 2 successive py::scoped_interpreter -> double free or corruption (out) #5412
Open
2 of 3 tasks
Labels
triage
New bug, unverified
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
v2.13
Problem description
I get:
double free or corruption (out)
Happens when having 2 successive non-overlapping
py::scoped_interpreter
(and doing module imports):Reproducible example code
Reproducible example: https://github.com/user706/pybind11_test
py::array_t
and "single"py::scoped_interpreter
(~> branch
main
)py::scoped_interpreter
(~> branch
works_when_having_only_single_scoped_interpreter
-> see diff): why?py::list
(~> branch
works_when_removing_numpy
-> see diff): why? (perhaps because of no import)Do this:
result:
It fails in this line, but only the 2nd time through the loop!!!
But if I simply change the following line
constexpr int NUM_LOOPS = 2;
to this
constexpr int NUM_LOOPS = 1;
then it will not fail.
Why does it fail with
NUM_LOOPS = 2
?How can one fix it?
Thanks
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: