From e24d5194308ace0cd71ee08fd847b7dcfc340d3d Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Tue, 9 Aug 2022 20:50:14 +0300 Subject: [PATCH] [asan] suppress the static variable leaks (#1085) * [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 * [asan] add missing SWSS_LOG_ENTER() Signed-off-by: Yakiv Huryk --- syncd/Asan.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/syncd/Asan.cpp b/syncd/Asan.cpp index d3f0c95d5..3bc84ff64 100644 --- a/syncd/Asan.cpp +++ b/syncd/Asan.cpp @@ -3,6 +3,13 @@ #include #include +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();