Skip to content

Commit ffc4109

Browse files
authored
[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 <[email protected]> * [asan] add missing SWSS_LOG_ENTER() Signed-off-by: Yakiv Huryk <[email protected]>
1 parent bfd37e3 commit ffc4109

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

syncd/Asan.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
#include <csignal>
44
#include <sanitizer/lsan_interface.h>
55

6+
extern "C" {
7+
const char* __lsan_default_suppressions() {
8+
// SWSS_LOG_ENTER(); // disabled
9+
return "leak:__static_initialization_and_destruction_0\n";
10+
}
11+
}
12+
613
static void sigterm_handler(int signo)
714
{
815
SWSS_LOG_ENTER();

0 commit comments

Comments
 (0)