CLion
 
Get CLion
You are viewing the documentation for an earlier version of CLion.

Google sanitizers

Last modified: 13 November 2023

Sanitizers are open-source tools for dynamic code analysis designed by Google. CLion integrates with the following Sanitizers:

  • AddressSanitizer (ASan)

  • LeakSanitizer (LSan)

  • ThreadSanitizer (TSan)

  • UndefinedBehaviorSanitizer (UBSsan)

  • MemorySanitizer (MSan)

Sanitizers are implemented in Clang starting 3.1 and GCC starting 4.8. All the sanitizers are available on Linux x86_64 machines. You can use AddressSanitizer on Windows 10 with clang-cl under the MSVC toolchain. For macOS, the supported sanitizers are AddressSanitizer, ThreadSanitizer, and UndefinedBehaviorSanitizer.

As Sanitizers are based on compiler instrumentation, you need to rebuild your project in order to start using these tools.