-
Notifications
You must be signed in to change notification settings - Fork 43
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
Segfault when iterating over multiple structures #317
Comments
This prints the residue fine:
However, this results in a segfault, which indicates that gemmi might be garbage collecting the memory when the variable gets reassigned within each iteration of the loop:
|
Interestingly, I can resolve this issue by storing an explicit reference to the
|
Yes, more or less. The |
Nice--I saw that nanobind v2.0.0 just got released last week. For the benefit of anyone else who finds this thread: I found a better solution than passing around a reference to the original structure that works for some use cases. In our case, we're extracting the |
Suppose I'm working with a randomly chosen PDB file:
The following code runs perfectly fine:
However, the following code results in a segfault:
The error is:
This issue strikes me as similar to #86
The text was updated successfully, but these errors were encountered: