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 — Data race: `sys.addaudithook()` lazily creates `interp->audit_hooks` with no lock · Issue #154431 · python/cpython Open Labels extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportFull report: https://gist.github.com/devdanzin/0b13838fd6089e73a3f063ed8f68e733 Repro: import sys, threading assert not sys._is_gil_enabled(), "run free-threaded: PYTHON_GIL=0" NADD = 24 # threads slamming the first-time lazy-init store (write @540) at once NAUD = 8 # threads spinning audit events (should_audit read @239) barrier = threading.Barrier(NADD + NAUD) def _hook(*a): return None def adder(): barrier.wait() for _ in range(200): sys.addaudithook(_hook) # write interp->audit_hooks (first time) @540 def auditor(): barrier.wait() for _ in range(200000): sys.audit("fusil.tsan.test") # should_audit read of interp->audit_hooks @239 ts = [threading.Thread(target=adder) for _ in range(NADD)] ts += [threading.Thread(target=auditor) for _ in range(NAUD)] for t in ts: t.start() for t in ts: t.join() print("done, no crash") The fix is incoming. Linked PRs
Activity
MetadataMetadataAssigneesLabelsextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-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. |