Reputation: 14682
We have a shared library that loads as an Apache module (plug-in). The module itself loads some other libraries, of course. I want to test one of these libraries for memory leaks, corruption etc. Looking at Valgrind tutorials I see that the only example is of running an executable under it. Obviously I don't want to run the full Apache server under Valgrind. Is there a way to instruct Valgrind to look only in a specific library?
Some other tools, like Purify, I used in the (quite distant) past required instrumentation during the compile time, so only the instrumented libraries would produce an output for the tool. Perhaps there are tools other than Valgrind that can do so?
We do have a command-line wrapper for the library in question, so yes, I can run it under Valgrind, but the scenarios we can reproduce with it are quite limited. I'd prefer to run the full application and reproduce the problematic scenarios while checking for the memory issues. Thanks!
Upvotes: 0
Views: 692
Reputation: 70402
Valgrind provides a command line option to allow you to specify suppressions from a file. You could use that to suppresss errors from anything other than your library.
--suppressions=<filename> [default: $PREFIX/lib/valgrind/default.supp]
Specifies an extra file from which to read descriptions of
errors to suppress. You may use up to 100 extra suppression
files.
You can look at the default suppression file for the syntax, but it is described here.
Upvotes: 1