[dpdk-users] Memory check with DPDK
Dolev Elbaz
dolevelbaz at microsoft.com
Thu Feb 11 11:13:44 CET 2021
Hi,
My team is working with DPDK and I'm trying to add a memory check to our app, using AddressSanitizer (ASan) or Valgrind. We're using gcc 7.5 on Linux (Ubuntu 18.04) and DPDK 20.11.
What I've tried so far:
* Added -fsanitize=address to compilation and link flags. It works for regular allocations (malloc/free) but since DPDK uses a custom allocator, ASan doesn't track any memory issues generated from rte_malloc or mempool_lib. Thus, not useful for most cases.
* Tried to manually poison memory using ASan interface: https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning. Requires manual un-poisoning for each allocation, so it's not feasible for an app of our scale.
* Noted valgring-dpdk (https://github.com/bluca/valgrind-dpdk/). It seems to be tested for DPDK 17.11 and have some issues on DPDK 18+ so it's not relevant (https://github.com/bluca/valgrind-dpdk/issues/4). Didn't find an official support in Valgrind for huge pages, except for this old repo: https://github.com/bisdn/valgrind-hugepages.
* Found debug flags in DPDK sources: RTE_MALLOC_DEBUG and RTE_LIBRTE_MEMPOOL_DEBUG but couldn't find a way to make them work with ASan.
Does anyone know how to add a memory check to DPDK-based apps?
Thanks,
Dolev
More information about the users
mailing list