Re: valgrind errors

Поиск
Список
Период
Сортировка
От Shachar Shemesh
Тема Re: valgrind errors
Дата
Msg-id 4087FB46.9060508@shemesh.biz
обсуждение исходный текст
Ответ на valgrind errors  (Neil Conway <neilc@samurai.com>)
Список 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 по дате отправления:

Предыдущее
От: Shachar Shemesh
Дата:
Сообщение: Re: License question
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: License question