Re: [dpdk-dev] [PATCH v2] Enable AddressSanitizer feature on DPDK
From: Peng, ZhihongX <hidden>
Date: 2021-09-17 09:12:14
-----Original Message----- From: David Marchand <redacted> Sent: Friday, September 17, 2021 4:23 PM To: Peng, ZhihongX <redacted> Cc: Burakov, Anatoly <redacted>; Ananyev, Konstantin [off-list ref]; Stephen Hemminger [off-list ref]; dev [off-list ref]; Lin, Xueqin [off-list ref] Subject: Re: [dpdk-dev] [PATCH v2] Enable AddressSanitizer feature on DPDK On Thu, Sep 16, 2021 at 3:47 AM [off-list ref] wrote:quoted
From: Zhihong Peng <redacted> 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.
quoted
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 <redacted> Signed-off-by: Zhihong Peng <redacted>-- David Marchand