]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-130519: Fix crash in QSBR when destructor reenters QSBR (gh-130553)
authorSam Gross <colesbury@gmail.com>
Wed, 26 Feb 2025 19:55:15 +0000 (14:55 -0500)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 19:55:15 +0000 (14:55 -0500)
commit45bc120d4504bff215938bca3f1d08cee2ed7a91
treea8b6b398da6fb4f77ac542eed7ad61089a1e074b
parent5c8e8704c39110da15956b0678303aff7dffb3be
gh-130519: Fix crash in QSBR when destructor reenters QSBR (gh-130553)

The `free_work_item()` function in QSBR may call arbitrary code via
Python object destructors, which may reenter the QSBR code. Reorder
the processing of work items to be robust to reentrancy.

Also fix the TODO for the out of memory situation.
Include/internal/pycore_pymem.h
Lib/test/test_capi/test_object.py
Modules/_testinternalcapi.c
Objects/obmalloc.c