Syscall write(buf) contains uninitialized or unaddressable bytes doesn't mean that it's sending uninitialized memory. I've run across this one a number of times when dealing with socket code. If you allocate say a 64k buffer (~ max datagram size) and then call send() with a length of 100 bytes which are all initialized, you get this error. Valgrind doesn't appear to have knowledge of what system calls do, so it doesn't know that there is a length parameter passed. It does know that you passed a pointer to a buffer, how much space was allocated for that buffer (64k) and how much of it was initialized (100 bytes). If all of it wasn't initialized it will give this warning.
I think it will even give this warning if you pass an uninitialized buffer to read() recv() or a similar call - which is normal use. As with all automatic checking software, the warnings are things that might be an error, but aren't necessarily. Use the locations provided in the output to go back and look at the code and see if it's really doing anything bad.


Andrew

Lee Dilkie wrote:
Most of the errors seem to be in one of these classes:
- Conditional jump or move depends on uninitialised value(s)
- Use of uninitialized value

When I run it in my own code (which seems correct to me), I
see this also:
- Syscall param write(buf) contains uninitialised or
unaddressable byte(s)

which is pretty disturbing to me, since that means it's
actually sending
uninitialized memory.



Can't speak for all the errors you are seeing but these "uninitialised"
memory errors are generally the result of OpenSSL's random number
generation. Random bytes generally get xor'ed into uninitialised (freshly
malloc-ed) memory and valgrind keeps track of that fact (xor-ing a known
value with an uninitialised value results in an uninitialised value as far
as valgrind is concerned). When it's time to use that memory (as when you
call a system function), an error is reported.

As I said, can't speak for your setup, but that's what I found when I
tracked down similar issues on my setup.

-lee

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]

Reply via email to