Possible false valgrind error reports
От
Karina Litskevich
Тема
Possible false valgrind error reports
Дата
Msg-id
CACiT8iaAET-fmzjjZLjaJC4zwSJmrFyL7LAdHwaYyjjQOQ4hcg@mail.gmail.com
Список
Дерево обсуждения
Possible false valgrind error reports Karina Litskevich <litskevichkarina@gmail.com>
Re: Possible false valgrind error reports Tom Lane <tgl@sss.pgh.pa.us>
Re: Possible false valgrind error reports Karina Litskevich <litskevichkarina@gmail.com>
Re: Possible false valgrind error reports Tom Lane <tgl@sss.pgh.pa.us>
Hi hackers,
In 82d0a46ea32 AllocSetRealloc() was changed to allow decreasing size of
external chunks and give memory back to the malloc pool. Two
VALGRIND_MAKE_MEM_UNDEFINED() calls were not changed to work properly in the
case of decreasing size: they can mark memory behind the new allocated memory
UNDEFINED. If this memory was already allocated and initialized, it's expected
to be DEFINED. So it can cause false valgrind error reports. I fixed it in 0001
patch.
Also, it took me a while to understand what's going on there, so in 0002 patch
I tried to improve comments and renamed a variable. Its name "oldsize" confused
me. I first thought "oldsize" and "size" represent the same parameters of the
old and new chunk. But actually "size" is new "chunk->requested_size" and
"oldsize" is old "chksize". So I believe it's better to rename "oldsize" into
"oldchksize".
Best regards,
Karina Litskevich
Postgres Professional: http://postgrespro.com/
In 82d0a46ea32 AllocSetRealloc() was changed to allow decreasing size of
external chunks and give memory back to the malloc pool. Two
VALGRIND_MAKE_MEM_UNDEFINED() calls were not changed to work properly in the
case of decreasing size: they can mark memory behind the new allocated memory
UNDEFINED. If this memory was already allocated and initialized, it's expected
to be DEFINED. So it can cause false valgrind error reports. I fixed it in 0001
patch.
Also, it took me a while to understand what's going on there, so in 0002 patch
I tried to improve comments and renamed a variable. Its name "oldsize" confused
me. I first thought "oldsize" and "size" represent the same parameters of the
old and new chunk. But actually "size" is new "chunk->requested_size" and
"oldsize" is old "chksize". So I believe it's better to rename "oldsize" into
"oldchksize".
Best regards,
Karina Litskevich
Postgres Professional: http://postgrespro.com/
В списке pgsql-hackers по дате отправления
От: Drouvot, Bertrand
Дата:
От: Anton A. Melnikov
Дата: