bug in SlabAlloc / VALGRIND_MAKE_MEM_DEFINED

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема bug in SlabAlloc / VALGRIND_MAKE_MEM_DEFINED
Дата
Msg-id a6543b6d-6015-99b1-63ef-3ed55a76a730@2ndquadrant.com
обсуждение исходный текст
Ответы Re: bug in SlabAlloc / VALGRIND_MAKE_MEM_DEFINED
Список pgsql-hackers
Hi,

Andres nagged to me about valgrind runs taking much longer since 
9fab40ad introduced the SlabContext into reorderbuffer.c. And by 
"longer" I mean hours instead of minutes.

After a bit of investigation I stumbled on this line in slab.c:

   VALGRIND_MAKE_MEM_DEFINED(chunk, SlabChunkGetPointer(chunk));

which is wrong, because the second parameter should be size and not 
another pointer. This essentially marks a lot of memory as defined, 
which results in the extreme test runtime.

Instead, the line should be:

   VALGRIND_MAKE_MEM_DEFINED(SlabChunkGetPointer(chunk), sizeof(int32));

Patch attached.

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: tuplesort_gettuple_common() and *should_free argument
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: tuplesort_gettuple_common() and *should_free argument