CLion
 
Get CLion
Join the CLion 2025.1 Early Access Program and try out new features before they are released! Find out more

Google sanitizers

Last modified: 26 May 2024

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.