Re: GetNamedLWLockTranche crashes on Windows in normal backend

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GetNamedLWLockTranche crashes on Windows in normal backend
Date: 2025-09-04 18:23:26
Message-ID: CAA5RZ0uCPdEngGPceCuqpOkeDR7uHA30M5hONhkJdcrmk+KLjQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

commit 38b602b certainly doesn't do us any favors here since it
> removed NamedLWLockTrancheArray. Given the lack of reports from the field,
> I suspect the best path forward is to add an ERROR for unsafe accesses and
> to fix the documentation, as discussed upthread.

I suggest we set an in progres flag for shmem_startup_hook, as we do for
shmem_request_hook, and error out this function if called outside of this
hook. The error will be something like this:

```
ERROR: cannot return the address of LWLocks outside of shmem_startup_hook
```

We can also update the docs.

If you agree with the above, I'll get the patch ready?

--
Sami Imseih
Amazon Web Services (AWS)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-09-04 18:24:48 Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters
Previous Message Masahiko Sawada 2025-09-04 18:15:21 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart