Re: A very quick observation of dangling pointers in Postgres pathlists

Поиск
Список
Период
Сортировка
От Andrei Lepikhov
Тема Re: A very quick observation of dangling pointers in Postgres pathlists
Дата
Msg-id 20be3d9d-4147-492a-b69c-d69a87a014a9@gmail.com
обсуждение
Ответ на A very quick observation of dangling pointers in Postgres pathlists  (Andrei Lepikhov <lepihov@gmail.com>)
Ответы Re: A very quick observation of dangling pointers in Postgres pathlists
Список pgsql-hackers
On 17/04/2026 10:56, Andrei Lepikhov wrote:
> The best-known problematic code example causing this issue is
> apply_scanjoin_target_to_paths(), and the current_rel/final_rel game from commit
> 0927d2f46dd.  Quickly fixing it, I see some more combinations have emerged:

On closer inspection, it looks like all the detected cases come from the same
issue in create_ordered_paths. The ordered_rel has the same path in its pathlist
as the input_rel. Sometimes, this path is removed and freed from ordered_rel,
which leads to a dangling pointer in the child RelOptInfo.

I've attached a patch that shows how to fix the issue. Some regression tests
change because of a hidden rule where a projection and its subpath have
different target lists. Right now, the patch always enforces a projection, even
if the target lists are the same. This is still open for discussion on whether
there's a better way to handle it.

-- 
regards, Andrei Lepikhov,
pgEdge
Вложения

В списке pgsql-hackers по дате отправления: