views:

42

answers:

2

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

+1  A: 

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.

Douglas Leeder
given that there may be thousands of reports produced just finding the error cases may be difficult. There will be a lot of error cases as well as I know there are a good few leaks in there. There'll also be a lot of duplicates which I was hoping that any merge tool would combine into one master report for me.
Glen
Hence my "if your code is mostly clean" statement. merging would be tricky in any case, as it would have to decide how much of the traceback mattered when comparing.
Douglas Leeder
A: 

A way to solve your problem should be to add --gen-suppressions=all option, and concat all ignored errors in your suppressions files. You have to sort true leaks and false leaks manually, but once it's done, valgrind will print only true leaks.

Then, if reports wrote anything, it is maybe you have to resolve memory leaks before proceed.

--quiet option is necessary : Run silently, and only print error messages. Useful if you are running regression tests or have some other automated test machinery.

Doomsday