What version (or hash if on master) of pybind11 are you using?
2.11.1
Problem description
Trying to access a field of type std::shared_ptr crashes the Python code immediately with double free or corruption.
This looks a bit like the reverse of https://github.com/pybind/pybind11/issues/1138 because the holder object should be a std::unique_ptr (at least the documentation says that this is the default holder object when no holder is specified) and the actual data instance is a std::shared_ptr. Not quite sure if the underlying cause is basically the same (=> duplicate) or if it makes sense to track it separately?
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.11.1
Problem description
Trying to access a field of type
std::shared_ptr
crashes the Python code immediately withdouble free or corruption
.This looks a bit like the reverse of https://github.com/pybind/pybind11/issues/1138 because the holder object should be a
std::unique_ptr
(at least the documentation says that this is the default holder object when no holder is specified) and the actual data instance is astd::shared_ptr
. Not quite sure if the underlying cause is basically the same (=> duplicate) or if it makes sense to track it separately?Reproducible example code
C++ code:
Python usage code:
Output:
Is this a regression? Put the last known working version here if it is.
Not a regression