Attribution: harness copies, bare file names, PyO3 frames and thread names - #1
Merged
Merged
Conversation
An uninstrumented library can record a source file with no directory. It was resolved against the working directory, which is the crate root in the image, so it passed for a crate file and became the primary location and the merge key. Only an absolute path under the crate root now counts. Signed-off-by: nimbrel <[email protected]>
…s race Only CPython's own content writers were recognised. A mutator refilling a numpy array reaches the buffer through numpy's copy loop and memmove, so the report was filed as the extension's certain race and failed the run. A mutator stack now counts as a content rewrite when a copy primitive is at the top, called from a library outside the interpreter, with no frame of the extension and no free, realloc or resize anywhere on it. CPython's containers stay excluded: their copies run under a critical section the extension must also hold. Harness races are located at the extension's access rather than in the mutator's library. Signed-off-by: nimbrel <[email protected]>
When one side of a report not attributed to the extension was an atomic helper from CPython's pyatomic headers, that side could become the primary location. The plain access is the racy one, so it is preferred. Signed-off-by: nimbrel <[email protected]>
A race whose access happened in PyO3's own source was reported at the extension's frame with no mention of PyO3. The classification and location are unchanged; the message now names the PyO3 crate, version and line, since a newer PyO3 may have changed that access. Signed-off-by: nimbrel <[email protected]>
Messages said "by thread T7", so a report caused by a mutator could not be recognised without the raw log. The thread's name now follows its id in the message, each stack carries a "thread" field in the JSON, and the text summary labels stacks with it. Deduplication is unaffected: the signature does not include the message. Signed-off-by: nimbrel <[email protected]>
Signed-off-by: nimbrel <[email protected]>
Signed-off-by: nimbrel <[email protected]>
nimbrel
added a commit
that referenced
this pull request
Sep 26, 2026
… frames and thread names TSan reports from a mutator refilling another library's buffer are classified as harness races, bare debug-info file names are no longer taken for crate files, races outside the extension are located at the plain access, and messages name threads and PyO3 frames.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes in how TSan reports are classified and located.
arr[:] = ...) goes through that library's copy loop, not CPython's, and was filed as the extension'scertainrace, failing the run. A copy primitive called from outside the interpreter, with no extension frame and no free/realloc/resize on the mutator's stack, is now a harness race, located at the extension's access.pyatomic*.h.threadfield.14 new tests in
tests/test_tsan_parse.pywith a synthetic data log; the TSan ground-truth suite passes locally (33 passed, 4 xfailed).