Skip to content

Commit

Permalink
[asan] add print_suppressions=0 to ASAN configs (sonic-net#11252)
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
Yakiv-Huryk authored and pull[bot] committed Jul 17, 2024
1 parent 83e4c2f commit 8db60ac
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
31 changes: 16 additions & 15 deletions dockers/docker-orchagent/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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]
Expand All @@ -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 %}
Expand Down Expand Up @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand All @@ -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 %}

Expand Down
3 changes: 2 additions & 1 deletion platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% set asan_extra_options = ':print_suppressions=0' %}
[supervisord]
logfile_maxbytes=1MB
logfile_backups=2
Expand Down Expand Up @@ -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 %}
41 changes: 21 additions & 20 deletions platform/vs/docker-sonic-vs/supervisord.conf.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% set asan_extra_options = ':print_suppressions=0' %}
[supervisord]
logfile_maxbytes=1MB
logfile_backups=2
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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 %}

0 comments on commit 8db60ac

Please sign in to comment.