[BUG]: Function with Param of type const Eigen::VectorXd&
causes "windows fatal exception: access violation" on Windows
#5181
Labels
triage
New bug, unverified
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
v2.10.4
Problem description
When calling function with parameter
const Eigen::VectorXd&
, it fails with "windows fatal exception: access violation" on Windows, compiled with VS2022, Python 3.12, and Pybind v2.10.4.However, the example works well with Python 3.10 + VS2019 + Pybind v2.10.4.
Besides, it also works well in Python 3.12 + VS2022 + Pybind current stable branch.
I know from the Documentation that it recommend using
Eigen::Ref
for reference. UsingEigen::Ref
, Python 3.12 + VS2022 + Pybind v2.10.4 also works.That said, using either Pybind current stable branch or
Eigen::Ref
can make it work.I have been struggling on this issue for a while.
I want to understand how things go wrong:
Eigen::Ref
works, butconst Eigen::VectorXd&
not?Reproducible example code
For a full example, see https://github.com/huweiATgithub/pybind_fail_example
The text was updated successfully, but these errors were encountered: