I've got an set of acceptance tests that run nightly. I'd like to use valgrind to check for memory leaks in my code automatically as an additional safe-guard to manually checking for leaks. Updating my scripts to run my processes under valgrind is trivial, however, each test starts and stops a number of processes and there are around 15000 test cases, so I'll end up with thousands of individual reports.
Is there a tool that's able to merge these reports? I've seen valkyrie, but according to the docs they don't support valgrind 3.5
Valgrind includes an option to check for memory leaks. With no option given, it will list a heap summary where it will say if there is any memory that has been allocated but not freed. If you use the option --leak-check=full it will give more information.
The main thing to point out with respect to threaded programs is that your program will use the native threading library, but Valgrind serialises execution so that only one (kernel) thread is running at a time.
The error message "Conditional jump or move depends on uninitialized value(s)" essentially means Valgrind has determined that the result of your program depends on uninitialized memory. Sometimes you will also see the message "Use of uninitialized value of size N".
If your code is mostly clean, then you could just keep the error cases.
If your going to right a tool to combine the outputs, then the valgrind xml output format might be the right thing to start with. At least then parsing shouldn't be too hard. You can also output the valgrind log to a different file to separate it from the programs' output. Also you can get valgrind to give an error when it detects a memory leak with --error-exitcode=
.
You'll still have to decide what counts as the same memory leak, when comparing leaks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With