GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Race in _ctypes_alloc_callback and libffi under free-threading · Issue #128485 · python/cpython Closed Labels 3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-ctypestopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:I built libffi with TSAN and cpython (3.13 branch) with free-threading and TSAN. The following python code reports TSAN warnings: import ctypes import concurrent.futures import threading def test_ctypes(): @ctypes.CFUNCTYPE(ctypes.c_float, ctypes.c_float, ctypes.c_float) def callback(a, b): return a / 2 + b / 2 if __name__ == "__main__": num_workers = 20 barrier = threading.Barrier(num_workers) def closure(): barrier.wait() test_ctypes() with concurrent.futures.ThreadPoolExecutor(max_workers=num_workers) as executor: futures = [] for i in range(num_workers): futures.append(executor.submit(closure)) assert len(list(f.result() for f in futures)) == num_workers TSAN report exract: More details on the build and the output: https://gist.github.com/vfdev-5/06b1c60713241e75773e9a92f2ecf135 The issue is with dlmalloc of libffi (reported here) Discussing the issue with @colesbury and @Yhg1s on discord, Thomas proposed the following fix (agreed by Sam):
CPython versions tested on:3.13 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-ctypestopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |