Re: Use-after-free of a shared Path in add_path()/add_partial_path() - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Use-after-free of a shared Path in add_path()/add_partial_path()
Date
Msg-id CAExHW5ur6z6u1OeYC8m6x500y-fBj5tFTicZC6Dz5FCJe=WWZQ@mail.gmail.com
Whole thread
List pgsql-hackers
On Tue, Sep 15, 2026 at 8:35 AM Richard Guo <guofenglinux@gmail.com> wrote:
>
> The alternatives are a flat copy of Path, and reference counting (and
> maybe more).  Copying also fixes the bug, so maybe it would be a
> workable solution too.  Reference counting is more appealing in
> principle, but I think it's far too large a change to back-patch.
>
> Thoughts?

FWIW, we discussed reference counting paths in [1]. It is invasive. We
had seen a similar report around that time or that thread references a
thread with a similar bug as this thread.

[1] https://www.postgresql.org/message-id/CAExHW5tUcVsBkq9qT%3DL5vYz4e-cwQNw%3DKAGJrtSyzOp3F%3DXacA%40mail.gmail.com
--
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: shihao zhong
Date:
Subject: Re: GIN index fast list search may become un-interruptible for long time.
Next
From: Ashutosh Bapat
Date:
Subject: Re: PGQ catalog representation and pg_dump support