Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what are the valid sanitizer suppression strings for gcc?

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?

like image 786
GranBurguesa Avatar asked Jan 15 '18 16:01

GranBurguesa


People also ask

What are GCC sanitizers?

The C/C++ compilers Clang/LLVM and GCC support so-called sanitizers. These sanitizers are built into the application code and track the execution at runtime to report execution errors. There are currently four interesting sanitizers: AddressSanitizer and LeakSanitizer.

What is AddressSanitizer GCC?

Address Sanitizer is a tool developed by Google detect memory access error such as use-after-free and memory leaks. It is built into GCC versions >= 4.8 and can be used on both C and C++ codes.

What is AddressSanitizer in c++?

Starting in Visual Studio 2019 version 16.9, the Microsoft C/C++ compiler (MSVC) and IDE supports the AddressSanitizer. AddressSanitizer (ASan) is a compiler and runtime technology that exposes many hard-to-find bugs with zero false positives: Alloc/dealloc mismatches and new / delete type mismatches.

What is error AddressSanitizer?

AddressSanitizer is a fast memory error detector. It consists of a compiler instrumentation module and a run-time library. The tool can detect the following types of bugs: Out-of-bounds accesses to heap, stack and globals. Use-after-free.


1 Answers

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
like image 164
GranBurguesa Avatar answered Sep 19 '22 19:09

GranBurguesa