Backpatch for fix simplehash to preserve consistency in case of OOM

From: Gilles Darold <gilles(at)darold(dot)net>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Backpatch for fix simplehash to preserve consistency in case of OOM
Date: 2026-11-20 16:59:09
Message-ID: 927fa326-00a5-4ff3-8ccb-b531008f0b3c@darold.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have experienced a PG 16.14 backend crashed with SIGSEGV during an
out-of-memory episode. Analysis of the core dump shows that this is the
bug fixed on master by commit b282fa88df ("simplehash: preserve consistency
in case of OOM.", 2023-11-17). That commit is in v17 and later, but it
was never back-patched to REL_16_STABLE. Here are the details of the
commit message:

commit b282fa88df78a05643d2df84a2b8e81cd9c1705d
Author: Jeff Davis <jdavis(at)postgresql(dot)org>
Date:   Fri Nov 17 13:58:16 2023 -0800

    simplehash: preserve consistency in case of OOM.

    Compute size first, then allocate, then update the structure.

    Previously, an out-of-memory when growing could leave the hashtable in
    an inconsistent state.

    Discussion:
https://postgr.es/m/20231117201334.eyb542qr5yk4gilq@awork3.anarazel.de
    Reviewed-by: Andres Freund
    Reviewed-by: Gurjeet Singh

Is it possible to back-patch it?

--
Gilles Darold

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-11-20 17:03:04 Re: pg_restore fails on extracted tar archives with large objects
Previous Message Ayush Tiwari 2026-11-20 16:58:52 Re: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000