pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix min_dynamic_shared_memory on Windows.
Date: Sat, 21 Oct 2023 21:26:50 +0000
Message-ID: <E1quJUg-001ik9-9y@gemulon.postgresql.org> (raw)

Fix min_dynamic_shared_memory on Windows.

When min_dynamic_shared_memory is set above 0, we try to find space in a
pre-allocated region of the main shared memory area instead of calling
dsm_impl_XXX() routines to allocate more.  The dsm_pin_segment() and
dsm_unpin_segment() routines had a bug: they called dsm_impl_XXX()
routines even for main region segments.  Nobody noticed before now
because those routines do nothing on Unix, but on Windows they'd fail
while attempting to duplicate an invalid Windows HANDLE.  Add the
missing gating.

Back-patch to 14, where commit 84b1c63a added this feature.  Fixes
pgsql-bugs bug #18165.

Reported-by: Maxime Boyer <maxime.boyer@cra-arc.gc.ca>
Tested-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/18165-bf4f525cea6e51de%40postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dab889d60bac3fbf691973ca1770f2eb50547999

Modified Files
--------------
src/backend/storage/ipc/dsm.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1quJUg-001ik9-9y@gemulon.postgresql.org>
Permalink:  ../E1quJUg-001ik9-9y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1quJUg-001ik9-9y@gemulon.postgresql.org

 · 

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: tmunro@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix min_dynamic_shared_memory on Windows.
  In-Reply-To: <E1quJUg-001ik9-9y@gemulon.postgresql.org>

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

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