-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Some GC types can crash during destruction if a GC runs executes #95324
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
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Jul 27, 2022
…UnTrack during deallocation in debug mode
pablogsal
added a commit
that referenced
this issue
Jul 27, 2022
…k during deallocation in debug mode (#95325)
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jul 27, 2022
…UnTrack during deallocation in debug mode (pythonGH-95325) (cherry picked from commit f40bc7f) Co-authored-by: Pablo Galindo Salgado <[email protected]>
pablogsal
added a commit
that referenced
this issue
Jul 27, 2022
…_UnTrack during deallocation in debug mode (GH-95325) (#95336) Co-authored-by: Pablo Galindo Salgado <[email protected]>
Also, perhaps the object structure contains invalid pointers (created while running tp_dealloc) that can be traced by tp_traverse. So this warning is a good idea. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have been bitten a couple of times already if C extension types that implement the GC interface don't call
PyObject_GC_UnTrack
in theirtp_dealloc
slot. The last issue was #95045Although this is technically not always an error (the
tp_free
slot untracks the object from the GC), if the GC executes during the deallocator is possible that it will see an object with 0 reference count.To avoid this in the future, we should add a warning if this happens so we can fix it within CPython
The text was updated successfully, but these errors were encountered: