CloudNativeDataPlane / cndp

Cloud Native Data Plane (CNDP) is a collection of user space libraries to accelerate packet processing for cloud applications using AF_XDP sockets as the primary I/O..
BSD 3-Clause "New" or "Revised" License
90 stars 32 forks source link

Run Memory Profiling using Valgrind #381

Open jalalmostafa opened 4 months ago

jalalmostafa commented 4 months ago

CNDP seems to have multiple memory issues including double frees and memory leaks I think we should do memory profiling e.g. using valgrind. An example is in PR #380

maryamtahhan commented 4 months ago

Hi @jalalmostafa I added a workflow to run cppcheck, the next thing will be to fixup all the reported issues in https://github.com/CloudNativeDataPlane/cndp/actions/runs/10115180237/job/27975372401 (expand the cat report section of the action) I can't find a marketplace action that can look for leaks without running a binary which introduces some complications into the workflow that I need to think about. If you have any ideas re possible actions please give me a shout

jalalmostafa commented 4 months ago

Hi @maryamtahhan

Thanks for adding cppcheck. Coverity Scan seems to have memory profiling using static analysis and it has an unofficial Github Action in the marketplace: https://github.com/marketplace/actions/unofficial-coverity-scan I have not used it before though.

Running the binary will catch more errors for sure. What kind of complications are there? Conceptually, I think we can run cnet-graph in a Github-hosted runner using a veth interface in AF_XDP copy mode. I use the xdp-tutorial veth scripts as a development environment.

https://github.com/xdp-project/xdp-tutorial/tree/48872cf472be83dc902d49c2b75e69c68af5c7de/testenv