Re: valgrind errors - Mailing list pgsql-hackers

From Shachar Shemesh
Subject Re: valgrind errors
Date
Msg-id 4087FB46.9060508@shemesh.biz
Whole thread Raw
In response to valgrind errors  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Min Xu (Hsu) wrote:

>I am confused by how valgrind define "make use" of data? Isn't
>"copy" data a type of "make use"? I mean, if valgrind checks if the
>data was used as inputs of memcpy(), it is fine. But if user uses
>his own memory_copy(), which loads the data into register,
>as if the data is going to be used in some useful computation,
>and then copy the register value to some other memory location
>to finish the copy (yeah, this IS slow), then valgrind is likely
>to be confused too. It may think the data is "used".
>
>I guess all I am saying is that valgrind _can_ still make
>mistakes about it.
>
>-Min
>  
>
If I understand correctly, a data is defined to be "used" when anything 
other than copying is done on it. Arithmetic operations, branches, etc. 
will trigger the error. If you copy the data by adding and then 
subtracting a constant from it, valgrind will complain. If all you do 
(as in your example) is copy it around, and then copy it some more, it 
will not.

Yes, it does keep "uninitialized" bits over your registers. Brrr.
         Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting
http://www.lingnu.com/



pgsql-hackers by date:

Previous
From: Shachar Shemesh
Date:
Subject: Re: License question
Next
From: Peter Eisentraut
Date:
Subject: Re: License question