Re: Segfaults in 18 and 19 when pgstats can't grow its DSA (back-patch of d9de60c5e4)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Colin McDonnell <colinmcd94(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, ju(dot)grigorev(at)ftdata(dot)ru
Subject: Re: Segfaults in 18 and 19 when pgstats can't grow its DSA (back-patch of d9de60c5e4)
Date: 2026-11-20 22:18:38
Message-ID: awDHPruxrhgevZ-b@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Nov 20, 2026 at 01:26:59PM -0800, Colin McDonnell wrote:
> This is the bug from the pgsql-hackers thread "DSA_ALLOC_NO_OOM vs
> dsm_create ERROR leaving a half-initialized pgstats hash entry" [1], fixed
> on master by d9de60c5e4 [2]. It stayed on master because d9de60c5e4 changes
> the signature of pgstat_init_entry(), which pgstat_internal.h exports. The
> attached patches make the same change on the stable branches without
> changing any existing signature, so I'd like to ask for a back-patch.

I can see that this is a clean backpatch of the other commit done on
HEAD. I don't mind the backpatch, let's just see first if others have
any comments and/or objections on this matter.

+ chunk = pgstat_alloc_entry_body(kind);
+ if (chunk == InvalidDsaPointer)
+ return NULL;
+
+ return pgstat_init_entry_ext(kind, shhashent, chunk);
[...]
+PgStatShared_Common *
+pgstat_init_entry_ext(PgStat_Kind kind,
+ PgStatShared_HashEntry *shhashent,
+ dsa_pointer chunk)

Introducing an "_ext()" flavor to bypass the ABI requirements sounds
good here.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2026-11-20 22:29:45 Re: BUG #19927: PostgreSQL 16: SQL dump adds experimental/incompatible options like \restrict
Previous Message Colin McDonnell 2026-11-20 21:26:59 Segfaults in 18 and 19 when pgstats can't grow its DSA (back-patch of d9de60c5e4)