]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-129069: Fix listobject.c data races due to memmove (gh-142957)
authorSam Gross <colesbury@gmail.com>
Fri, 19 Dec 2025 23:06:47 +0000 (18:06 -0500)
committerGitHub <noreply@github.com>
Fri, 19 Dec 2025 23:06:47 +0000 (18:06 -0500)
commite46f28c6afce9c85e4bc4a113d1c7efc472e7d8f
tree9908fd0c62e879c93ac89940c1619c16dd07d269
parent4ea3c1a04747978361b497798428423cbb6a7146
gh-129069: Fix listobject.c data races due to memmove (gh-142957)

The use of memmove and _Py_memory_repeat were not thread-safe in the
free threading build in some cases. In theory, memmove and
_Py_memory_repeat can copy byte-by-byte instead of pointer-by-pointer,
so concurrent readers could see uninitialized data or tearing.

Additionally, we should be using "release" (or stronger) ordering to be
compliant with the C11 memory model when copying objects within a list.
Objects/listobject.c
Tools/tsan/suppressions_free_threading.txt