On Thu, Sep 16, 2021 at 3:47 AM <zhihongx.p...@intel.com> wrote: > > From: Zhihong Peng <zhihongx.p...@intel.com> > > AddressSanitizer (ASan) is a google memory error detect > standard tool. It could help to detect use-after-free and > {heap,stack,global}-buffer overflow bugs in C/C++ programs, > print detailed error information when error happens, large > improve debug efficiency. > > By referring to its implementation algorithm > (https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm), > enable heap-buffer-overflow and use-after-free functions on dpdk. > DPDK ASAN function currently only supports on Linux x86_64. > > Here is an example of heap-buffer-overflow bug: > ...... > char *p = rte_zmalloc(NULL, 7, 0); > p[7] = 'a'; > ...... > > Here is an example of use-after-free bug: > ...... > char *p = rte_zmalloc(NULL, 7, 0); > rte_free(p); > *p = 'a'; > ...... >
Unfortunately, this won't build with some (too smart) compilers. Can you look at the CI report? Thanks. > If you want to use this feature, > you need to add below compilation options when compiling code: > -Dbuildtype=debug -Db_lundef=false -Db_sanitize=address > "-Dbuildtype=debug": Display code information when coredump occurs > in the program. > "-Db_lundef=false": It is enabled by default, and needs to be > disabled when using asan. > > Signed-off-by: Xueqin Lin <xueqin....@intel.com> > Signed-off-by: Zhihong Peng <zhihongx.p...@intel.com> -- David Marchand