what are the valid sanitizer suppression strings for gcc?

2.3k views Asked by At

When using sanitizers with gcc one can provide a list of exceptions/suppressions to deal with false positives and such.

the suppression file format is poorly documented.

Each suppression is of the form

name_of_check:path_or_name

What are the valid values for name_of_check?

1

There are 1 answers

0
GranBurguesa On BEST ANSWER

I resorted to grabbing the values from the source code. These are based on gcc 10.1:

  • ubsan/undefined - see libsanitizer/ubsan/ubsan_checks.inc
    • undefined
    • null
    • pointer-overflow
    • alignment
    • object-size
    • signed-integer-overflow
    • unsigned-integer-overflow
    • integer-divide-by-zero
    • float-divide-by-zero
    • invalid-builtin-use
    • implicit-unsigned-integer-truncation
    • implicit-signed-integer-truncation
    • implicit-integer-sign-change
    • shift-base
    • shift-exponent
    • bounds
    • unreachable
    • return
    • vla-bound
    • float-cast-overflow
    • bool
    • enum
    • function
    • returns-nonnull-attribute
    • nonnull-attribute
    • vptr
    • cfi
  • asan/address - see libsanitizer/asan/asan_suppressions.cpp
    • interceptor_name
    • interceptor_via_fun
    • interceptor_via_lib
    • odr_violation
  • lsan/leak - see libsanitizer/lsan/lsan_common.cpp
    • leak
  • tsan/thread - see libsanitizer/tsan/tsan_suppressions.h
    • none
    • race
    • race_top
    • mutex
    • thread
    • signal
    • called_from_lib
    • deadlock