-
Notifications
You must be signed in to change notification settings - Fork 2.2k
make_iterator throws exception after re-initializing interpreter #2101
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
This does look like an actual bug. Here's a cleaner example that reproduces the error:
|
I would really like to see a fix to this one. I am depending on this feature and my users can only run once and then close my app and start over. |
@bobbay It probably was refactored, but if it's static registered state than it's likely in get_internals() pybind11/include/pybind11/detail/internals.h Line 101 in 4c7e509
|
Confirmed that the above link is correct as #2650 renamed it. |
* Clear local internals after finalizing interpreter * Add descriptive comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ybind#3744) * Clear local internals after finalizing interpreter * Add descriptive comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Clear local internals after finalizing interpreter * Add descriptive comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue description
make_iterator
on some begin/end pair of a containermake_iterator
again, same as aboveResult: An exception is thrown "instance allocation failed: new instance has no pybind11-registered base types".
Reproducible example code
Proposed Fix
The culprit seems to be static state in
pybind11::detail::registered_local_types_cpp()
. Clearing that container (deleting the heap-allocated values in it beforehand) infinalize_interpreter()
appears to fix the issue.The text was updated successfully, but these errors were encountered: