diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-09-18 17:39:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 17:39:27 (GMT) |
commit | 74a7f5d2dacd4c05aad0e64a275dae97d18f5355 (patch) | |
tree | d654c4b110caa5290f650689af46d6d6f8a8d59e /Misc/ACKS | |
parent | 0620bc7f78782cd2e400827aaf834f358250778f (diff) | |
download | cpython-74a7f5d2dacd4c05aad0e64a275dae97d18f5355.zip cpython-74a7f5d2dacd4c05aad0e64a275dae97d18f5355.tar.gz cpython-74a7f5d2dacd4c05aad0e64a275dae97d18f5355.tar.bz2 |
[3.12] gh-109496: Detect Py_DECREF() after dealloc in debug mode (GH-109539) (#109545)
gh-109496: Detect Py_DECREF() after dealloc in debug mode (GH-109539)
On a Python built in debug mode, Py_DECREF() now calls
_Py_NegativeRefcount() if the object is a dangling pointer to
deallocated memory: memory filled with 0xDD "dead byte" by the debug
hook on memory allocators. The fix is to check the reference count
*before* checking for _Py_IsImmortal().
Add test_decref_freed_object() to test_capi.test_misc.
(cherry picked from commit 0bb0d88e2d4e300946e399e088e2ff60de2ccf8c)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Misc/ACKS')
0 files changed, 0 insertions, 0 deletions