Hello,

I would like to use valgrind to check for memory errors in vpp.

I understand that running something through valgrind makes it very very slow so 
that it is not an option for real production usage of vpp. However, valgrind is 
still very useful for finding errors even if it's only for very limited test 
runs, so I would very much like to make that work.

I know that vpp has some built-in checking for memory leaks, but the reason I 
want to use valgrind is not primarily to check for memory leaks but to check 
for other kinds of memory-access-related errors, like the "invalid read" and 
"invalid write" errors that valgrind can detect.

So far, what I have done is to build vpp (debug configuration) according to the 
instructions here: 
https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/developers/building.html
Then I stopped the vpp service since I want to run vpp from the command-line 
through valgrind, and finally I run it like this:

sudo valgrind vpp -c /etc/vpp/startup.conf

That gave warnings about "client switching stacks?" and suggested adding 
--max-stackframe=137286291952 so I did that:

sudo valgrind --max-stackframe=137286291936 vpp -c /etc/vpp/startup.conf

Then valgrind gives a warning "Warning: set address range perms: large range" 
followed by some error reports of the type "Conditional jump or move depends on 
uninitialised value(s)" inside the mspace_malloc routine in dlmalloc.c.

I think these issues are probably related to the fact that vpp uses its own 
malloc implementation (in dlmalloc.c) instead of the default malloc, possibly 
combined with the fact that vpp uses very large (virual) memory.

Questions:

- Are there ways to configure vpp to allow it to work together with valgrind?

- Are there ways to make vpp use less memory? (currently "top" shows 0.205t 
VIRT memory usage for the vpp_main process)

- Is it possible to somehow configure vpp to use standard malloc instead of the 
dlmalloc.c implementation, perhaps sacrificing performance but making things 
work better with valgrind?

Best regards,
Elias
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#13923): https://lists.fd.io/g/vpp-dev/message/13923
Mute This Topic: https://lists.fd.io/mt/34077527/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to