Skip to content
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

terminate called after throwing an instance of 'pybind11::cast_error' what(): return_value_policy = copy, but type is non-copyable! (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details) Aborted (core dumped) #45

Open
kefeimo opened this issue May 12, 2023 · 6 comments · May be fixed by VOLTTRON/pybind11#10
Assignees

Comments

@kefeimo
Copy link
Contributor

kefeimo commented May 12, 2023

======== Your Input Here: ==(Master-)======

0.843 0
terminate called after throwing an instance of 'pybind11::cast_error'
what(): return_value_policy = copy, but type is non-copyable! (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
Aborted (core dumped)

Afect version

0.3.0 (after adopting the newer version of Pybind11)

Note:

The command went through and took effect.

@kefeimo kefeimo self-assigned this May 12, 2023
@wangyanbao666
Copy link

Hi may I know which version did you use for pybind11? I have upgraded to the latest pybind11 version but still got the error.

@kefeimo
Copy link
Contributor Author

kefeimo commented Sep 12, 2023

Hi @wangyanbao666, thanks for your interests in this issue. The pybind version is v2.9.2. (Note that the build process uses the pybind source code directly at /deps/pybind11 (pybind11 @ 338d615,) for more detailed about build, please see Notes-on-Packaging.md.

As a walkaround, you may try dnp3-py < 0.3.0 (i.e., pip install dnp3-python==0.2.3b3), which support python 2.8, 3.9, 3.10.

The root cause of this issue is the pybind11 being used does not support the C++ source code (i.e., dnp3 @ 7d84673) after Python 3.11. Note that the elements play essential roles here are C++ Opendnp3 code, pybind11, cmake, python, and ancilary biding code. The solution might require either updating the Opendnp3 C++ source code (along with ancillary binding code) or utilizing a suitable pybind11 that is compatible with both Python 3.11 (along with the cmake version) which can properly interpret the C++ code.

@wangyanbao666
Copy link

Thanks for your reply and the issue has been solved now!

@kefeimo
Copy link
Contributor Author

kefeimo commented Sep 16, 2023

@wangyanbao666, good to know that the issue is resolved. Would you mind sharing what's taken action that resolved the problem?

@zagor
Copy link

zagor commented Oct 23, 2023

FYI I combined patches by @shawgree and @bbarcklay with modern pybind11 into a dnp3-python that builds and runs with Python 3.11: https://github.com/zagor/dnp3-python

This was referenced Oct 28, 2023
@kefeimo
Copy link
Contributor Author

kefeimo commented Oct 28, 2023

FYI I combined patches by @shawgree and @bbarcklay with modern pybind11 into a dnp3-python that builds and runs with Python 3.11: https://github.com/zagor/dnp3-python

@zagor, thanks for sharing the fix. It works on my end.

@craig8, I verified the fix on py3.11 py3.10 (PR: #47)
Note: for a complete PR, we need to update the pybind11 submodule tag (PR: VOLTTRON/pybind11#10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants