0

GCC has many sanitizers (e.g., leak, address, thread). But many of them require instumentation of the code and cannot be used together with others. So if in practice I want to apply all the sanitizers to make sure my code works well, what is a recommended procedure to use all these sanitizers?

I manage my project using CMake

Harper
  • 1,794
  • 14
  • 31

1 Answers1

1

Some sanitizers can be combined together in the same run: Asan+UBsan+Lsan (and optionally Isan, if your program does not have intentional unsigned overflows). All other sanitizers (e.g. Tsan or Msan) require separate QA runs (which implies rebuilding SW for every run). Also you'll most likely want a dedicated CI run for Valgrind (it can detect some errors which Asan can't and it can not be applied to sanitized code due to implementation details).

yugr
  • 19,769
  • 3
  • 51
  • 96