-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-44263: Fix _decimal and _testcapi GC protocol #26464
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
Conversation
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function.
It's possible to access the internal
|
PyDecSignalDictMixin_Type doesn't contain any Python object. It cannot be part of a reference cycle. So it doesn't have to be tracked by the GC. Its structure only contains 32-bit flags:
|
The following script does crash in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Is it worth it adding this as a regression test? |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-26465 is a backport of this pull request to the 3.10 branch. |
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <[email protected]>
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-26466 is a backport of this pull request to the 3.9 branch. |
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <[email protected]>
@vstinner is the issue number correct? |
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <[email protected]>
|
I consider that my PR #26463 is generic check for such bug. |
The _ssl.SSLError fix was merged with no test: see #26439 |
is defined with Py_TPFLAGS_HAVE_GC.
Py_TPFLAGS_HAVE_GC since it has no traverse function.
https://bugs.python.org/issue44263