-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[BUG]: make_iterator causes runtime error in second scoped_interpreter #3776
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
Any thoughts @StarQTius? |
The following snippet results in the expected behavior on my machine:
So it has to do with the dynamic linkage or maybe EMBEDDED_MODULES do some cleanup that MODULES don't I believe. I've checked with |
@StarQTius I can also confirm that |
Well, I might have been wrong when I said locals were not duplicated. This is the address of the variable containing the internals when
And this is what GDB displays when the breakpoint is hit twice more:
It seems like the locals are internally linked. Is it the intended behavior ? |
@StarQTius I don't think we have any defined behavior for the locals between interpreters (which is partially what caused these bugs). So whichever resolves these bugs. I don't see any reason why they should be linked unless there is some global configuration state that should be shared between them. |
Then I think the best solution would be to register a callback in |
Could Anyone provide the compilation command, I'm getting a segmentation fault, I'm new to this. |
|
Uh oh!
There was an error while loading. Please reload this page.
Required prerequisites
Problem description
This issue is similar to #2101, the reported minimal example problem in #2101 is fixed in the latest master because of #3744. However, the below minimal example will produce the error
I can reproduce this problem in Ubuntu and macOS.
The real use case is that each gtest
TEST
block will have its ownpy::scoped_interpreter
, and this bug is preventing me from writingfor i in testclass:
more than once, but I would like to writefor i in testclass:
in multiple differentTEST
blocks.Reproducible example code
CMakeLists.txt
pybindsample.cpp
pybindsample_test.cpp
The text was updated successfully, but these errors were encountered: