You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Land a proposed upstream change so I can continue to make progress on
the Swift side. If the upstream patch changes before it lands, this will
create a merge conflict which I will fix by aligning this change with
whatever we decided to do upstream.
Original upstream patch description/commit message:
We implemented the `ignore_noninstrumented_modules` flag for Darwin [1]
to be able to use TSan on Darwin, where the "re-compile the world"
approach is difficult to follow in practice.
Now we are in the same situation when adding TSan support for Swift on
Linux. The libdispatch library is a source of false positives and
compiling it with TSan (although it is compiled from source on Linux)
proves to be tricky and insufficient. The better path seems to be to
make `ignore_noninstrumented_modules` work on Linux.
The missing piece with this functionality on Linux is the detection
whether or not a loaded library is instrumented (which is suprisingly
difficult). In this patch we use the ELF segment metadata and symbol
table to check whether any sanitizer symbols are present. [2,3] were
useful resources in the development of this patch (especially,
`getSymbolCountFromGnuHash`).
Also enable flag for libdispatch tests on Linux to make them pass. The
default value for this flag on Linux remains OFF.
[1]: https://reviews.llvm.org/D28264
[2]: https://chromium.googlesource.com/crashpad/crashpad/+/1f1657d573c789aa36b6022440e34d9ec30d894c%5E%21/
[3]: https://flapenguin.me/2017/05/10/elf-lookup-dt-gnu-hash/
Differential Revision: https://reviews.llvm.org/D61708
apple-llvm-split-commit: eb0abd168a7ae46fa7c622303f3dcc4e11f956d0
apple-llvm-split-dir: compiler-rt/
0 commit comments