From 8db60ac5aed9238798afb87de5c550e91b5685da Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Tue, 28 Jun 2022 18:45:52 +0300 Subject: [PATCH] [asan] add print_suppressions=0 to ASAN configs (#11252) - Why I did it To provide an ability to suppress ASAN false positives and have a clean ASAN report for docker-sonic-vs/mlnx-syncd/orchagent docker - How I did it Added the "print_suppressions=0" to ASAN configs. - How to verify it add a suppression to some ASAN-enabled component (the suppression should catch some leak) build with ENABLE_ASAN=y run a test and see that the ASAN report is empty instead of having the suppression summary Signed-off-by: Yakiv Huryk --- dockers/docker-orchagent/supervisord.conf.j2 | 31 +++++++------- .../docker-syncd-mlnx/supervisord.conf.j2 | 3 +- .../vs/docker-sonic-vs/supervisord.conf.j2 | 41 ++++++++++--------- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/dockers/docker-orchagent/supervisord.conf.j2 b/dockers/docker-orchagent/supervisord.conf.j2 index 7cd31a113223..9751a58bb833 100644 --- a/dockers/docker-orchagent/supervisord.conf.j2 +++ b/dockers/docker-orchagent/supervisord.conf.j2 @@ -36,6 +36,7 @@ dependent_startup=true {% set orchagent_dependent_startup_wait_for = "rsyslogd:running" %} {%- endif %} {%- endif %} +{% set asan_extra_options = ':print_suppressions=0' %} {% if is_fabric_asic == 0 %} [program:gearsyncd] @@ -50,7 +51,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/gearsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/gearsyncd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -65,7 +66,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/portsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/portsyncd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -79,7 +80,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for={{ orchagent_dependent_startup_wait_for }} {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/orchagent-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/orchagent-asan.log{{ asan_extra_options }}" {% endif %} [program:swssconfig] @@ -94,7 +95,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=orchagent:running {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/swssconfig-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/swssconfig-asan.log{{ asan_extra_options }}" {% endif %} {% if is_fabric_asic == 0 %} @@ -124,7 +125,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=orchagent:running {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/coppmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/coppmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -139,7 +140,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/neighsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/neighsyncd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -154,7 +155,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/vlanmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/vlanmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -169,7 +170,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/intfmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/intfmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -184,7 +185,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/portmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/portmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -199,7 +200,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/buffermgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/buffermgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -214,7 +215,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/vrfmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/vrfmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -229,7 +230,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/nbrmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/nbrmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -244,7 +245,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/vxlanmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/vxlanmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -259,7 +260,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/tunnelmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/tunnelmgrd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} @@ -284,7 +285,7 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} diff --git a/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 b/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 index cc07096b20c6..a6c7e8121ab8 100644 --- a/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 +++ b/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 @@ -1,3 +1,4 @@ +{% set asan_extra_options = ':print_suppressions=0' %} [supervisord] logfile_maxbytes=1MB logfile_backups=2 @@ -38,5 +39,5 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/syncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/syncd-asan.log{{ asan_extra_options }}" {% endif %} diff --git a/platform/vs/docker-sonic-vs/supervisord.conf.j2 b/platform/vs/docker-sonic-vs/supervisord.conf.j2 index a49f33866edf..ba63d2b77dda 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf.j2 +++ b/platform/vs/docker-sonic-vs/supervisord.conf.j2 @@ -1,3 +1,4 @@ +{% set asan_extra_options = ':print_suppressions=0' %} [supervisord] logfile_maxbytes=1MB logfile_backups=2 @@ -43,7 +44,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/syncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/syncd-asan.log{{ asan_extra_options }}" {% endif %} [program:gbsyncd] @@ -71,7 +72,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/portsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/portsyncd-asan.log{{ asan_extra_options }}" {% endif %} [program:orchagent] @@ -82,7 +83,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/orchagent-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/orchagent-asan.log{{ asan_extra_options }}" {% endif %} [program:coppmgrd] @@ -93,7 +94,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/coppmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/coppmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:neighsyncd] @@ -104,7 +105,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/neighsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/neighsyncd-asan.log{{ asan_extra_options }}" {% endif %} [program:teamsyncd] @@ -115,7 +116,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/teamsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/teamsyncd-asan.log{{ asan_extra_options }}" {% endif %} [program:vlanmgrd] @@ -126,7 +127,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/vlanmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/vlanmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:intfmgrd] @@ -137,7 +138,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/intfmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/intfmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:portmgrd] @@ -148,7 +149,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/portmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/portmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:teammgrd] @@ -159,7 +160,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/teammgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/teammgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:zebra] @@ -194,7 +195,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/fpmsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/fpmsyncd-asan.log{{ asan_extra_options }}" {% endif %} [program:arp_update] @@ -213,7 +214,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/buffermgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/buffermgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:vrfmgrd] @@ -224,7 +225,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/vrfmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/vrfmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:restore_neighbors] @@ -245,7 +246,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/nbrmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/nbrmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:vxlanmgrd] @@ -256,7 +257,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/vxlanmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/vxlanmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:sflowmgrd] @@ -267,7 +268,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/sflowmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/sflowmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:natmgrd] @@ -278,7 +279,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/natmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/natmgrd-asan.log{{ asan_extra_options }}" {% endif %} [program:natsyncd] @@ -289,7 +290,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/natsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/natsyncd-asan.log{{ asan_extra_options }}" {% endif %} [program:fdbsyncd] @@ -300,7 +301,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log{{ asan_extra_options }}" {% endif %} [program:tunnelmgrd] @@ -311,5 +312,5 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog {% if ENABLE_ASAN == "y" %} -environment=ASAN_OPTIONS="log_path=/var/log/asan/tunnelmgrd-asan.log" +environment=ASAN_OPTIONS="log_path=/var/log/asan/tunnelmgrd-asan.log{{ asan_extra_options }}" {% endif %}