Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I merge Valgrind memcheck reports from multiple runs of the same process?

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

like image 816
Glen Avatar asked Jun 24 '10 22:06

Glen


People also ask

How do I get more information from Valgrind?

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.

Is Valgrind single threaded?

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.

What does conditional jump mean in Valgrind?

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".


1 Answers

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.

like image 151
Douglas Leeder Avatar answered Oct 02 '22 21:10

Douglas Leeder