Re: Segmentation fault on proc exit after dshash_find_or_insert - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Segmentation fault on proc exit after dshash_find_or_insert
Date
Msg-id 144130.1768405080@sss.pgh.pa.us
Whole thread Raw
In response to Re: Segmentation fault on proc exit after dshash_find_or_insert  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Segmentation fault on proc exit after dshash_find_or_insert
List pgsql-hackers
Amit Langote <amitlangote09@gmail.com> writes:
> On Wed, Jan 14, 2026 at 6:36 PM Álvaro Herrera <alvherre@kurilemu.de> wrote
>> Looking at ProcKill, I notice that we do some LWLock ops after its
>> LWLockReleaseAll() call, which seems a bit silly.  Why not do that right
>> after the "if (MyProc->lockGroupLeader != NULL)" block instead?  Nothing
>> uses LWLocks from there on.  This can be a separate commit.

> Just to confirm: you're suggesting moving the LWLockReleaseAll() call
> to after the "if (MyProc->lockGroupLeader != NULL)" block? Makes sense
> -- odd to release all locks right before then going ahead and
> acquiring one. Agreed it should be a separate commit.

I think the idea there might be to make sure that we have released
any pre-existing hold of that lock.  Otherwise this could be
a self-deadlock.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Japin Li
Date:
Subject: Re: Add IS_INDEX macro to brin and gist index
Next
From: Robert Haas
Date:
Subject: Re: [BUG] [PATCH] pg_basebackup produces wrong incremental files after relation truncation in segmented tables