[asan] add debug package for asan-enabled containers (#10953)

This is to improve the readability of ASAN reports. The debug package adds function names and source code references to the backtrace (currently, there are only binary addresses of functions)

Another way to address this issue is to build the image with "INSTALL_DEBUG_TOOLS=y". The downside of this approach is that the image size and compilation time are unnecessarily big. Also, the idea is to make the "ENABLE_ASAN" self-sufficient, which would not be the case for this approach.

- Why I did it
To improve the readability of asan logs.

- How I did it
Added SYNCD_DBG and SWSS_DBG to corresponding docker images for ASAN_ENABLE=y build

- How to verify it
Add artificial memory leak
Build with ASAN_ENABLE=y
Test the image and check the ASAN report

Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
This commit is contained in:
Yakiv Huryk 2022-05-31 09:24:18 +03:00 committed by GitHub
parent 8c1ded61b0
commit bd91b2eef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -21,6 +21,10 @@ include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MFT)
ifeq ($(ENABLE_ASAN), y)
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD_DBG)
endif
$(DOCKER_SYNCD_BASE)_FILES += $(ISSU_VERSION_FILE)
$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \

View File

@ -6,6 +6,10 @@ DOCKER_ORCHAGENT_DBG = $(DOCKER_ORCHAGENT_STEM)-$(DBG_IMAGE_MARK).gz
$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS)
ifeq ($(ENABLE_ASAN), y)
$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS_DBG)
endif
$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \
$(LIBSWSSCOMMON_DBG) \

View File

@ -21,12 +21,10 @@ $(SYNCD)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBTHRIFT_DEV)
$(SYNCD)_DPKG_TARGET = binary-syncd-rpc
endif
ifeq ($(INSTALL_DEBUG_TOOLS), y)
SYNCD_DBG = syncd-dbg_1.0.0_$(CONFIGURED_ARCH).deb
$(SYNCD_DBG)_DEPENDS += $(SYNCD)
$(SYNCD_DBG)_RDEPENDS += $(SYNCD)
$(eval $(call add_derived_package,$(SYNCD),$(SYNCD_DBG)))
endif
ifeq ($(ENABLE_SYNCD_RPC),y)
SYNCD_RPC_DBG = syncd-rpc-dbg_1.0.0_$(CONFIGURED_ARCH).deb