Re: pgsql: Introduce a new mechanism for registering shared memory areas

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: pgsql: Introduce a new mechanism for registering shared memory areas
Дата
Msg-id 261dc9d4-0b87-4e7e-aded-842ed82298e5@iki.fi
обсуждение
Ответ на Re: pgsql: Introduce a new mechanism for registering shared memory areas  (Aleksander Alekseev <aleksander@tigerdata.com>)
Список pgsql-committers
On 06/04/2026 14:55, Aleksander Alekseev wrote:
>> Introduce a new mechanism for registering shared memory areas
>>
>> [...]
> 
> This commit introduced a memory leak which Valgrind is very much upset about.
> 
> ShmemRequestStructWithOpts() allocates a copy of `options` in
> TopMemoryContext and passes it to ShmemRequestInternal(). It appends
> it to pending_shmem_requests as request->options. Later in
> ShmemInitRequested() when the list is freed `->options` leak. There
> are similar issues in ShmemAttachRequested() and
> CallShmemCallbacksAfterStartup() which free pending_shmem_requests
> without freeing `->options`.
> 
> I propose to fix it as attached.

LGTM, I will push this shortly. Thanks!

- Heikki




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