summaryrefslogtreecommitdiffstats
path: root/Tools/tsan
Commit message (Collapse)AuthorAgeFilesLines
* gh-117657: Fix data races report by TSAN unicode-hash (gh-119907)Donghee Na2024-06-031-1/+0
|
* gh-117657: Fix TSAN reported race in `_PyEval_IsGILEnabled`. (#119921)Sam Gross2024-06-021-1/+0
| | | | The GIL may be disabled concurrently with this call so we need to use a relaxed atomic load.
* gh-117657: Add TSAN suppression for `set_discard_entry` (#119908)Sam Gross2024-06-011-0/+2
| | | Seen in CI occasionally when running `test_weakref`.
* gh-117657: Fix TSAN race in QSBR assertion (#119887)Sam Gross2024-06-011-2/+0
| | | | Due to a limitation in TSAN, all reads from `PyThreadState.state` must be atomic to avoid reported races.
* gh-117657: Fix TSAN race in free-threaded GC (#119883)Sam Gross2024-06-011-3/+0
| | | | | Only call `gc_restore_tid()` from stop-the-world contexts. `worklist_pop()` can be called while other threads are running, so use a relaxed atomic to modify `ob_tid`.
* gh-117657: Fix itertools.count thread safety (#119268)Arnon Yaari2024-05-211-1/+0
| | | Fix itertools.count in free-threading mode
* gh-117657: Log TSAN warnings to separate files and archive them (#118747)mpage2024-05-101-0/+3
| | | | | | | This ensures we don't lose races that occur in subprocesses or interleave races from workers running in parallel. Log files are collected and packaged into a zipfile that can be downloaded from the "Artifacts" section of the workflow run.
* gh-117657: Fix QSBR race condition (#118843)Alex Turner2024-05-101-1/+0
| | | | | | `_Py_qsbr_unregister` is called when the PyThreadState is already detached, so the access to `tstate->qsbr` isn't safe without locking the shared mutex. Grab the `struct _qsbr_shared` from the interpreter instead.
* gh-117657: Fix data races reported by TSAN on `interp->threads.main` (#118865)mpage2024-05-101-2/+0
| | | Use relaxed loads/stores when reading/writing to this field.
* gh-117657: Replace TSAN suppresions with more specific rules (#118722)Brett Simmers2024-05-091-24/+81
| | | | | | | | | Using `race:` filters out warnings if the function appears anywhere in the stack trace. This can hide a lot of unrelated warnings, especially for a function like `_PyEval_EvalFrameDefault`, which is somewhere on the stack more often than not. Change all free-threaded suppressions to `race_top:`, which only matches the top frame, and add any new suppressions this exposes.
* gh-117657: Fix data races when writing / reading `ob_gc_bits` (#118292)mpage2024-05-081-3/+0
| | | | | Use relaxed atomics when reading / writing to the field. There are still a few places in the GC where we do not use atomics. Those should be safe as the world is stopped.
* gh-117657: Disable the function/code cache in free-threaded builds (#118301)mpage2024-05-031-1/+0
| | | | This is only used by the specializing interpreter and the tier 2 optimizer, both of which are disabled in free-threaded builds.
* gh-117657: TSAN fix race on `gstate->young.count` (#118313)Alex Turner2024-04-291-1/+0
|
* gh-117657: Fix race data race in `_Py_IsOwnedByCurrentThread()` (#118258)mpage2024-04-261-1/+0
|
* gh-117657: Fixes a few small TSAN issues in dictobject (#118200)Dino Viehland2024-04-251-3/+0
| | | | Fixup TSAN errors for dict
* gh-117657: Add a couple more TSAN suppressions (#118256)mpage2024-04-251-0/+5
|
* gh-117657: Fix data race in `_Py_IsImmortal` (#118261)mpage2024-04-251-1/+0
| | | | The load of `ob_ref_local races with stores. Using a relaxed load is sufficient; stores to the field are relaxed.
* gh-117657: use relaxed loads for checking dict keys immortality (#118067)Dino Viehland2024-04-191-2/+0
| | | Use relaxed load to check if dictkeys are immortal
* gh-117657: Quiet erroneous TSAN reports of data races in `_PySeqLock` (#117955)mpage2024-04-171-2/+0
| | | | | | | | Quiet erroneous TSAN reports of data races in `_PySeqLock` TSAN reports a couple of data races between the compare/exchange in `_PySeqLock_LockWrite` and the non-atomic loads in `_PySeqLock_{Abandon,Unlock}Write`. This is another instance of TSAN incorrectly modeling failed compare/exchange as a write instead of a load.
* gh-117657: Fix data races in the method cache in free-threaded builds (#117954)mpage2024-04-171-1/+0
| | | | | | | | | Fix data races in the method cache in free-threaded builds These are technically data races, but I think they're benign (to the extent that that is actually possible). We update cache entries non-atomically but read them atomically from another thread, and there's nothing that establishes a happens-before relationship between the reads and writes that I can see.
* gh-117657: Add TSAN suppressions for the free-threaded build (#117736)mpage2024-04-152-3/+53
| | | | | Additionally, reduce the iterations for a few weakref tests that would otherwise take a prohibitively long amount of time (> 1 hour) when TSAN is enabled and the GIL is disabled.
* gh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601)Donghee Na2024-03-151-0/+5