Skip to content

Make std::sync::Arc compatible with ThreadSanitizer#65097

Merged
bors merged 1 commit intorust-lang:masterfrom
tmiasko:arc
Mar 21, 2020
Merged

Make std::sync::Arc compatible with ThreadSanitizer#65097
bors merged 1 commit intorust-lang:masterfrom
tmiasko:arc

Conversation

@tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Oct 4, 2019

The memory fences used previously in Arc implementation are not properly
understood by thread sanitizer as synchronization primitives. This had
unfortunate effect where running any non-trivial program compiled with
-Z sanitizer=thread would result in numerous false positives.

Replace acquire fences with acquire loads to address the issue.

Fixes #39608.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-sanitizers Area: Sanitizers for correctness and code quality S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThreadSanitizer detects a data race in the test runner (rustc --test)