build: enable AddressSanitizer
authorZhihong Peng <zhihongx.peng@intel.com>
Wed, 20 Oct 2021 07:46:40 +0000 (15:46 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 29 Oct 2021 13:25:34 +0000 (15:25 +0200)
commit6e0290250d5cfa19a3cdb5e6a30634ddd317c85d
tree8f76622648ff202c56d916713a64c81b88aba50b
parent4d2d1258151657d69b0be5d118956b7e809f9d47
build: enable AddressSanitizer

AddressSanitizer [1] a.k.a. ASan is a widely-used debugging tool to
detect memory access errors.
It helps to detect issues like use-after-free, various kinds of buffer
overruns in C/C++ programs, and other similar errors, as well as
printing out detailed debug information whenever an error is detected.

ASan is integrated with gcc and clang and can be enabled via a meson
option: -Db_sanitize=address
See the documentation for details (especially regarding clang).

Enabling ASan has an impact on performance since additional checks are
added to generated binaries.

Enabling ASan with Windows is currently not supported in DPDK.

1: https://github.com/google/sanitizers/wiki/AddressSanitizer

Signed-off-by: Xueqin Lin <xueqin.lin@intel.com>
Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
config/meson.build
devtools/words-case.txt
doc/guides/prog_guide/asan.rst [new file with mode: 0644]
doc/guides/prog_guide/index.rst
doc/guides/rel_notes/release_21_11.rst