Re: [Bug] Usage of stale dead_items pointer in parallel vacuum - Mailing list pgsql-bugs

From Richard Guo
Subject Re: [Bug] Usage of stale dead_items pointer in parallel vacuum
Date
Msg-id CAMbWs4-0B0MjTdDFmtzKS8_2ZETzK8zmk_7DuHy3Xz_3=64EQQ@mail.gmail.com
Whole thread Raw
In response to Re: [Bug] Usage of stale dead_items pointer in parallel vacuum  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-bugs
On Thu, Oct 2, 2025 at 2:09 PM John Naylor <johncnaylorls@gmail.com> wrote:
> On Thu, Oct 2, 2025 at 11:17 AM Richard Guo <guofenglinux@gmail.com> wrote:
> > I can reproduce the issue and confirm that your patch fixes it.  I
> > didn't use your custom malloc allocator but instead applied a
> > redundant palloc0 for TidStore in TidStoreCreateShared(), hoping to
> > get a different chunk of memory (haha).

> I'm starting to wonder if we should have something similar to that
> allocator in core, which is actually here and not in the link
> upthread:

+1.  This issue is more like a reuse-after-free rather than a
use-after-free, and it doesn't seem easy to detect with current tools.
This kind of allocator seems to be quite useful -- it has helped catch
at least two bugs in our code so far.

- Richard



pgsql-bugs by date:

Previous
From: "White, Ian Keith"
Date:
Subject: RE: IN List operator , where list of values are over a number of lines
Next
From: Etsuro Fujita
Date:
Subject: Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c