Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Latest commit

 

History

History
32 lines (21 loc) · 855 Bytes

llvm-sanitizers.md

File metadata and controls

32 lines (21 loc) · 855 Bytes

LLVM TSAN / ASAN

For multithreaded and low-level unsafe interfacing server code, the ability to use LLVM's ThreadSanitizer and
AddressSanitizer can help troubleshoot invalid thread usage and invalid usage/access of memory.

There is a blog post outlining the usage of TSAN.

The short story is to use the swiftc command line options -sanitize=address and -santize=thread to each respective tool.

Also for Swift Package Manager projects you can use --sanitize at the command line, e.g.:

swift build --sanitize=address

or

swift build --sanitize=thread

and it can be used for the tests too:

swift test --sanitize=address

or

swift test --sanitize=thread