Re: GetNamedLWLockTranche crashes on Windows in normal backend

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Sami Imseih <samimseih(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-08 16:55:14
Message-ID: aL8KcsrCdPhDBmps@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 04, 2025 at 08:35:13PM -0500, Nathan Bossart wrote:
> On Thu, Sep 04, 2025 at 04:12:09PM -0500, Sami Imseih wrote:
>>> Yeah, I think modeling this after commit 4f2400c is a reasonable thing to
>>> explore.
>>
>> Here it is as described above.
>
> Thanks. This looks like the right idea to me, but let's give some time for
> others to comment.

I've started preparing this for commit, and I realized that restricting
GetNamedLWLockTranche() to shmem_startup_hook is not sufficient.
EXEC_BACKEND builds will run this hook in every backend, so unless it's
guarded behind some sort of "if (!found)" condition (i.e., only run in the
postmaster), it'll still crash. I think we just need to add some extra
notes to the docs and check for !IsUnderPostmaster, as discussed upthread.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-09-08 17:02:29 Re: PgStat_HashKey padding issue when passed by reference
Previous Message Emmanuel Sibi 2025-09-08 16:43:54 Re: [BUG] PostgreSQL crashes with ThreadSanitizer during early initialization