agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Aleksander Alekseev <aleksander@tigerdata.com>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Introduce a new mechanism for registering shared memory areas
Date: Mon, 6 Apr 2026 15:38:53 +0300
Message-ID: <261dc9d4-0b87-4e7e-aded-842ed82298e5@iki.fi> (raw)
In-Reply-To: <CAJ7c6TN9tp8MTc0WXM0zfSWqjfBqU8gpe+o5KqHB1-cQ7409Kw@mail.gmail.com>
References: <E1w9WsZ-00399s-08@gemulon.postgresql.org>
	<CAJ7c6TN9tp8MTc0WXM0zfSWqjfBqU8gpe+o5KqHB1-cQ7409Kw@mail.gmail.com>

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






view thread (3+ messages)

Message-ID: <261dc9d4-0b87-4e7e-aded-842ed82298e5@iki.fi>
Permalink:  ../261dc9d4-0b87-4e7e-aded-842ed82298e5@iki.fi/
Also on:    postgresql.org/message-id/261dc9d4-0b87-4e7e-aded-842ed82298e5@iki.fi

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: hlinnaka@iki.fi, aleksander@tigerdata.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Introduce a new mechanism for registering shared memory areas
  In-Reply-To: <261dc9d4-0b87-4e7e-aded-842ed82298e5@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox