[PATCH] D88559: [Sanitizer] Add interceptor for ptsname

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 14:07:16 PDT 2020


eugenis added a comment.

Consider a function that returns a pointer to a static buffer with the contents that are somehow initialized internally with proper synchronization. If the interceptor uses _WRITE, TSan will understand that as a data race because it can not see the internal synchronization. That why _INITIALIZE macro is used by MSan (the memory has somehow been initialized) but not by TSan (there may not have been a store there *right now*).

Another example is strerror which sometimes returns a pointer to static data (always initialized, does not require any sanitizer handling) and sometimes to a freshly allocated thread-local buffer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88559/new/

https://reviews.llvm.org/D88559



More information about the llvm-commits mailing list