-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Throwing a c++ exception in a rvalue causes an abort #1878
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
Comments
https://github.com/pybind/pybind11/blob/master/include/pybind11/pybind11.h#L1831 comment might be useful. |
Thanks for the pointer. The error happens here: pybind11/include/pybind11/pybind11.h Line 1822 in c9d32a8
|
Confirmed to still be an issue in 2.5.0. The issue is that somehow, a Python error is already set, yet the |
Issue description
When throwing a c++ exception inside a method of an object that is an rvalue (=has no name associated) AND printing in the destructor, then the program aborts.
Reproducible example code
pybind11 c++ python module definition:
When using the python module as follows, the python interpreter aborts:
The output is:
By assigning the just created object to a variable, the abort disappears:
The text was updated successfully, but these errors were encountered: