Skip to content

tsan: keep each access's line in the finding key - #5

Merged
nimbrel merged 3 commits into
mainfrom
fix/dedup-keeps-line
Sep 27, 2026
Merged

nimbrel merged 3 commits into
mainfrom
fix/dedup-keeps-line

Conversation

@nimbrel

@nimbrel nimbrel commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Two different races in one file whose top frames share a name (for example two Drop impls, both inlined as drop) were merged into one finding, so the second race disappeared as an occurrence of the first. The key was rule|path|tops, with no line.

  • The key is now rule|tops|anchors: for each access stack, the file:line of the frame the finding would be located at, sorted so the same race reported from either side stays one finding. Frames with no line fall back to the file, as before.
  • A finding whose primary frame has no line merges only with its own key, instead of sitting at line 1 and absorbing others in that file.
  • Harness and external reports are merged separately, so one can no longer absorb the other.

The JSON shape is unchanged; the only difference is the findings that used to be merged away. SARIF output carries no fingerprints derived from this key.

  • New fixture racy/two-drops-one-file: two Drop impls racing at different lines, previously one finding, now two, asserted under ci and stress.
  • racy/race-in-dependency-callbacks no longer needs #[inline(never)] helpers to keep its races apart.
  • 6 new parser tests.

Reports were deduplicated by rule, file and top symbols. Inlined frames are
named by their function alone, so two different races in one file under the
same name (two Drop impls, both `drop`) became one finding, the second
counted as an occurrence of the first.

The signature is now the rule, the top symbols and, for each access, the
file and line of the frame the finding would be located at, sorted so the
same race from either side is still one key. A frame without a line falls
back to its file, as before. Findings merge on their primary line only
within one classification, and a primary with no line merges only on its
signature instead of at line 1.

Signed-off-by: nimbrel <[email protected]>
Two Drop impls each race on their own counter. Inlined, both accesses are
symbolised as `drop` in src/lib.rs, so only the line tells them apart. The
sanitizer suite asserts one finding at each line, under ci and stress.

Signed-off-by: nimbrel <[email protected]>
…ture

Each Drop impl now does its racy write itself, as the fixture's two drops
are both symbolised `drop` in one file. The sanitizer suite asserts its
three races are reported at their own lines.

Signed-off-by: nimbrel <[email protected]>
@nimbrel
nimbrel merged commit 4dd2ed7 into main Sep 27, 2026
6 checks passed
@nimbrel nimbrel mentioned this pull request Sep 27, 2026
@nimbrel
nimbrel deleted the fix/dedup-keeps-line branch September 28, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant