* [dpdk-dev] memory leak reported by address sanitizer
@ 2021-06-03 18:53 Cosmin Banu
0 siblings, 0 replies; only message in thread
From: Cosmin Banu @ 2021-06-03 18:53 UTC (permalink / raw)
To: dev
Hello,
After a recent DPDK upgrade I noticed a memory leak on exit when running
with address sanitizer:
=================================================================
==2260==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 3805032 byte(s) in 71 object(s) allocated from:
#0 0x7fa6cffb6bc8 in malloc
(/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
#1 0x55e4ee478a76 in pci_scan_one ../drivers/bus/pci/linux/pci.c:225
#2 0x55e4ee4795d5 in rte_pci_scan ../drivers/bus/pci/linux/pci.c:487
#3 0x55e4ee539552 in rte_bus_scan
../lib/librte_eal/common/eal_common_bus.c:50
#4 0x55e4ee566217 in rte_eal_init ../lib/librte_eal/linux/eal.c:1065
After a bit of digging, it looks like the issue is the following return
statement:
https://github.com/DPDK/dpdk/blob/v20.11/drivers/bus/pci/linux/pci.c#L335
The behavior changed in this commit:
https://github.com/DPDK/dpdk/commit/c79a1c67465d0193b52e2ae4b64dd8362c575b2b
The issue can be fixed by either freeing the memory, or adding the device:
free(dev);
// or
rte_pci_add_device(dev);
However, I don't know which is the correct behavior.
I would appreciate any feedback.
Thank you,
Cosmin
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-07 19:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 18:53 [dpdk-dev] memory leak reported by address sanitizer Cosmin Banu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).