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).
To make it easier to write suppressions, you can use the --gen-suppressions=yes option which tells Valgrind to print out a suppression for each error that appears, which you can then copy into a suppressions file.
Valgrind is (mostly) a memory error detector for Linux. It's very good at finding leaks and uninitialised variables; unfortunately it's too good, and usually produces a number of false positives. It comes with suppression files which automatically silence some of these; but not enough, and none specific to wxGTK.
Uninitialized value errors 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".
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.
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.
I had the same problem with OpenSSL. According to Tom Hughes on the Valgrind mailing list, its not possible. See Frame-level wildcard not matching in suppression rule?.
In my case, I was trying to use frame level wildcards to suppress findings on the memory touched by RAND_init_fips
(the OpenSSL FIPS version of the problem). This does not work, though we would like it to work:
{
RAND_init_fips_1
Memcheck:Cond
...
fun:RAND_init_fips
...
}
{
RAND_init_fips_2
Memcheck:Value8
...
fun:RAND_init_fips
...
}
{
RAND_init_fips_3
Memcheck:Value4
...
fun:RAND_init_fips
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With