How to suppress valgrind warnings by the origin of the uninitialized values?

Calmarius picture Calmarius · Jul 24, 2013 · Viewed 8.3k times · Source

Valgrind will tell you the origin of the uninitialized values with the track-origins=yes option.

I tried to suppress these warnings but the problem is that data based on uninitialized values can propagate everywhere, causing warnings elsewhere too.

The solution would be suppressing by the origin of the uninitialized data. How can I do it? Is it possible? It seems suppress files only filter the stack trace only.

The reason I want this, that OpenSSL enhances randomness by using uninitialized values on purpose, and I want to test a release build with valgrind (so -DPURIFY is not an option).

Answer

Arthur Shipkowski picture Arthur Shipkowski · Aug 22, 2013

My initial read of your question is that you might be okay with disabling all uninitialized value errors, in which case --undef-value-errors=no would do the trick.

If you're looking for something piecemeal, some hasty testing seems to indicate using --gen-suppressions=yes, then answering y for the relevant outputs and dropping them in a suppressions file worked for me when fiddling with my openssl binary.

Also, you might find the answer to How do you tell Valgrind to completely suppress a particular .so file? useful.