This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Add support for disable_sanitizer_instrumentation attribute
ClosedPublic

Authored by glider on Aug 17 2021, 4:21 AM.

Details

Summary

Unlike attribute((no_sanitize("thread"))), this one will cause TSan
to skip the entire function during instrumentation.

Depends on https://reviews.llvm.org/D108029

Diff Detail

Event Timeline

glider created this revision.Aug 17 2021, 4:21 AM
glider requested review of this revision.Aug 17 2021, 4:21 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 17 2021, 4:21 AM
melver accepted this revision.Aug 17 2021, 1:53 PM
melver added inline comments.
clang/docs/ThreadSanitizer.rst
106

s/to a certain function/to functions/

108

It might be clearer to say

.. of instrumentation. As a result, it may introduce false positives and incorrect stack traces. Therefore, it should be used with care, and only if absolutely required; for example for certain code that cannot tolerate any instrumentation and resulting side-effects. This attribute overrides ``no_sanitize("thread")``.

to deter normal users from using this.

clang/test/CodeGen/sanitize-thread-disable.c
12
30
46
This revision is now accepted and ready to land.Aug 17 2021, 1:53 PM
glider updated this revision to Diff 368056.Aug 23 2021, 3:26 AM
glider marked 5 inline comments as done.

Addressed Marco's comments

This revision was landed with ongoing or failed builds.Aug 23 2021, 3:40 AM
This revision was automatically updated to reflect the committed changes.