25a0ce5eb1
Implement infrastructure that allows enabling address sanitizer for docker containers. Enable address sanitizer for SWSS container. - Why I did it To add a possibility to compile SONiC applications with address sanitizer (ASAN). ASAN is a memory error detector for C/C++. It finds: 1. Use after free (dangling pointer dereference) 2. Heap buffer overflow 3. Stack buffer overflow 4. Global buffer overflow 5. Use after return 6. Use after the scope 7. Initialization order bugs 8. Memory leaks - How I did it By adding new ENABLE_ASAN configuration option. - How to verify it By default ASAN is disabled and the SONiC image is not affected. When ASAN is enabled it inspects all allocation, deallocation, and memory usage that the application does in run time. To verify whether the application has memory errors tests that trigger memory usage of the application should be run. Ideally, the whole regression tests should be run. Memory leaks reports will be placed in /var/log/asan/ directory of SONiC host OS. Signed-off-by: Oleksandr Ivantsiv <oivantsiv@nvidia.com>
302 lines
7.0 KiB
Django/Jinja
302 lines
7.0 KiB
Django/Jinja
[supervisord]
|
|
logfile_maxbytes=1MB
|
|
logfile_backups=2
|
|
nodaemon=true
|
|
|
|
[eventlistener:dependent-startup]
|
|
command=python3 -m supervisord_dependent_startup
|
|
autostart=true
|
|
autorestart=unexpected
|
|
startretries=0
|
|
exitcodes=0,3
|
|
events=PROCESS_STATE
|
|
buffer_size=1024
|
|
|
|
[eventlistener:supervisor-proc-exit-listener]
|
|
command=/usr/bin/supervisor-proc-exit-listener --container-name swss
|
|
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
|
|
autostart=true
|
|
autorestart=unexpected
|
|
buffer_size=1024
|
|
|
|
[program:rsyslogd]
|
|
command=/usr/sbin/rsyslogd -n -iNONE
|
|
priority=1
|
|
autostart=false
|
|
autorestart=unexpected
|
|
stdout_logfile=syslog
|
|
stderr_logfile=syslog
|
|
dependent_startup=true
|
|
|
|
{% set is_fabric_asic = 0 %}
|
|
{% set orchagent_dependent_startup_wait_for = "portsyncd:running" %}
|
|
{% if DEVICE_METADATA.localhost.switch_type %}
|
|
{% if DEVICE_METADATA.localhost.switch_type == "fabric" %}
|
|
{% set is_fabric_asic = 1 %}
|
|
{% set orchagent_dependent_startup_wait_for = "rsyslogd:running" %}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:gearsyncd]
|
|
command=/usr/bin/gearsyncd -p /usr/share/sonic/hwsku/gearbox_config.json
|
|
priority=3
|
|
autostart=false
|
|
autorestart=false
|
|
startsecs=0
|
|
startretries=0
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:portsyncd]
|
|
command=/usr/bin/portsyncd
|
|
priority=3
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
[program:orchagent]
|
|
command=/usr/bin/orchagent.sh
|
|
priority=4
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
|
|
[program:swssconfig]
|
|
command=/usr/bin/swssconfig.sh
|
|
priority=5
|
|
autostart=false
|
|
autorestart=unexpected
|
|
startretries=0
|
|
startsecs=0
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:restore_neighbors]
|
|
command=/usr/bin/restore_neighbors.py
|
|
priority=6
|
|
autostart=false
|
|
autorestart=false
|
|
startsecs=0
|
|
startretries=0
|
|
stdout_logfile=syslog
|
|
stderr_logfile=syslog
|
|
dependent_startup=true
|
|
dependent_startup_wait_for=swssconfig:exited
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:coppmgrd]
|
|
command=/usr/bin/coppmgrd
|
|
priority=6
|
|
autostart=false
|
|
autorestart=false
|
|
startretries=0
|
|
startsecs=0
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:neighsyncd]
|
|
command=/usr/bin/neighsyncd
|
|
priority=7
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:vlanmgrd]
|
|
command=/usr/bin/vlanmgrd
|
|
priority=8
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:intfmgrd]
|
|
command=/usr/bin/intfmgrd
|
|
priority=9
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:portmgrd]
|
|
command=/usr/bin/portmgrd
|
|
priority=10
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:buffermgrd]
|
|
command=/usr/bin/buffermgrd.sh
|
|
priority=11
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:vrfmgrd]
|
|
command=/usr/bin/vrfmgrd
|
|
priority=13
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:nbrmgrd]
|
|
command=/usr/bin/nbrmgrd
|
|
priority=15
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:vxlanmgrd]
|
|
command=/usr/bin/vxlanmgrd
|
|
priority=16
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:tunnelmgrd]
|
|
command=/usr/bin/tunnelmgrd
|
|
priority=17
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
[program:enable_counters]
|
|
command=/usr/bin/enable_counters.py
|
|
priority=12
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
stderr_logfile=syslog
|
|
dependent_startup=true
|
|
dependent_startup_wait_for=swssconfig:exited
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:fdbsyncd]
|
|
command=/usr/bin/fdbsyncd
|
|
priority=17
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_logfile=syslog
|
|
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"
|
|
{% endif %}
|
|
{%- endif %}
|
|
|
|
{% if is_fabric_asic == 0 %}
|
|
[program:tunnel_packet_handler]
|
|
command=/usr/bin/tunnel_packet_handler.py
|
|
priority=12
|
|
autostart=false
|
|
autorestart=unexpected
|
|
stdout_logfile=syslog
|
|
stderr_logfile=syslog
|
|
dependent_startup=true
|
|
dependent_startup_wait_for=swssconfig:exited
|
|
{%- endif %}
|