-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-38070: visit_decref() calls _PyObject_IsFreed() #15782
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
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure that the object is not freed. If it's freed, the program fails with an assertion error and Python dumps informations about the freed object.
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
I compared performances without/with the change. (*) Test 1: ./configure --with-pydebug; make; ./python -m test -j0 # using 8 logical CPUs and gcc -Og
(*) Test 2: bm_deltablue.py of pyperformance "Benchmark hidden because not significant (1): deltablue" Ok, it seems like this change has no significant impact on a debug build of Python. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure that the object is not freed. If it's freed, the program fails with an assertion error and Python dumps informations about the freed object. (cherry picked from commit d91d4de) Co-authored-by: Victor Stinner <[email protected]>
GH-15793 is a backport of this pull request to the 3.8 branch. |
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure that the object is not freed. If it's freed, the program fails with an assertion error and Python dumps informations about the freed object. (cherry picked from commit d91d4de) Co-authored-by: Victor Stinner <[email protected]>
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure that the object is not freed. If it's freed, the program fails with an assertion error and Python dumps informations about the freed object.
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure
that the object is not freed. If it's freed, the program fails with
an assertion error and Python dumps informations about the freed
object.
https://bugs.python.org/issue38070