Search code examples
clinuxmemory-leaksopensslvalgrind

Valgrind: disable conditional jump (or whole library) check


I am developing application using OpenSSL API. As it known, OpenSSL uses miriades of global variables which are taken by Valgrind as errors ("conditional jump or move..." etc). Thus the Valgrind's output gets clogged with errors from shared libraries. This is very inconvenient for debug purposes, because every time I get:

More than X total errors detected. I'm not reporting any more. Final error counts will be inaccurate. Go fix your program!

The questions are:

  1. Can I disable party libraries (-lssl and -lcrypto in my case) memory checks in Valgrind?

  2. OR can I focus only on "definitly lost" errors?

    Thank you.


Solution

  • Valgrind can be configured to suppress errors in libraries.

    Details on this you find here: http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress

    From the web-page linked above:

    Note: By far the easiest way to add suppressions is to use the --gen-suppressions=yes option described in Core Command-line Options. This generates suppressions automatically. For best results, though, you may want to edit the output of --gen-suppressions=yes by hand, in which case it would be advisable to read through this section.