Re: Segmentation fault on proc exit after dshash_find_or_insert

amit <amitlangote09@gmail.com>

From: Amit Langote <amitlangote09@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Rahila Syed <rahilasyed90@gmail.com>, Andres Freund <andres@anarazel.de>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-01-16T05:52:49Z
Lists: pgsql-hackers
Hi Álvaro,

On Wed, Jan 14, 2026 at 10:56 PM Amit Langote <amitlangote09@gmail.com> wrote:
> On Wed, Jan 14, 2026 at 6:36 PM Álvaro Herrera <alvherre@kurilemu.de> wrote
> > I would add an Assert(num_held_lwlocks == 0) at the
> > end of LWLockReleaseAll(), to make it clear that it's idempotent (which
> > is important for the case where ProcKill will call it again shortly
> > after).
>
> Makes sense.  Will do.

Done and pushed.  I struggled to write a comment to describe the Assert though.

-- 
Thanks, Amit Langote



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix segfault from releasing locks in detached DSM segments