Skip to content

Commit

Permalink
[asan] suppress the static variable leaks (#1085) (#1159)
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>
  • Loading branch information
Yakiv-Huryk authored Jan 3, 2023
1 parent 6fc86a9 commit 0994449
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 0994449

Please sign in to comment.