Skip to content

Commit

Permalink
[asan] suppress the static variable leaks (sonic-net#1085)
Browse files Browse the repository at this point in the history
* [asan] suppress the static variable leaks

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>

* [asan] add missing SWSS_LOG_ENTER()

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

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

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

0 comments on commit 91190df

Please sign in to comment.