> -----Original Message----- > From: David Marchand <david.march...@redhat.com> > Sent: Friday, September 17, 2021 4:23 PM > To: Peng, ZhihongX <zhihongx.p...@intel.com> > Cc: Burakov, Anatoly <anatoly.bura...@intel.com>; Ananyev, Konstantin > <konstantin.anan...@intel.com>; Stephen Hemminger > <step...@networkplumber.org>; dev <dev@dpdk.org>; Lin, Xueqin > <xueqin....@intel.com> > Subject: Re: [dpdk-dev] [PATCH v2] Enable AddressSanitizer feature on DPDK > > 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.
I am trying to solve this issue.If there is no good solution, this test case will be removed. 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