]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-124375: Avoid calling `_PyMem_ProcessDelayed` on other thread states (#124459)
authorSam Gross <colesbury@gmail.com>
Tue, 15 Oct 2024 16:09:35 +0000 (12:09 -0400)
committerGitHub <noreply@github.com>
Tue, 15 Oct 2024 16:09:35 +0000 (16:09 +0000)
commit54c6fcbefd33a8d8bf8c004cf1aad3be3d37b933
treec6e949380952257bcfa9c852682ce544915e1965
parente97910cdb76c1f1dadfc4721b828611e4f4b6449
gh-124375: Avoid calling `_PyMem_ProcessDelayed` on other thread states (#124459)

This fixes a crash when running the PyO3 test suite on the free-threaded
build. The `qsbr` field is initialized after the `PyThreadState` is
added to the interpreter's linked list -- it might still be NULL.

Instead, we "steal" the queue of to-be-freed memory blocks. This is
always initialized (possibly empty) and protected by the stop the world
pause.
Misc/NEWS.d/next/Core_and_Builtins/2024-10-15-15-29-41.gh-issue-124375.wNrWVa.rst [new file with mode: 0644]
Python/gc_free_threading.c