Skip to content

Commit

Permalink
[asan] suppress the static variable leaks
Browse files Browse the repository at this point in the history
This is to suppress ASAN false positives for static variables.
For example, the ServiceMethodTable::m_slots is sometimes reported as
leaked.

Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
  • Loading branch information
Yakiv-Huryk committed Jul 20, 2022
1 parent bc7ccc2 commit bb70011
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions syncd/Asan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#include <csignal>
#include <sanitizer/lsan_interface.h>

extern "C" {
const char* __lsan_default_suppressions() {
return "leak:__static_initialization_and_destruction_0\n";
}
}

static void sigterm_handler(int signo)
{
SWSS_LOG_ENTER();
Expand Down

0 comments on commit bb70011

Please sign in to comment.