Re: BUG #18374: Printing memory contexts on OOM condition might lead to segmentation fault

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: BUG #18374: Printing memory contexts on OOM condition might lead to segmentation fault
Дата
Msg-id CAPpHfduPAmF95Zg=sMfhBW+0Q=Bq2KKzF7AamvTQ0UDm80ZOLA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18374: Printing memory contexts on OOM condition might lead to segmentation fault  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #18374: Printing memory contexts on OOM condition might lead to segmentation fault  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Sun, Mar 3, 2024 at 11:39 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I do think it's probably worth reducing MemoryContextDelete's stack
> usage to O(1), just to ensure we can't get into stack trouble during
> transaction abort.  That's not hard at all, as attached.
>
> I tried to make MemoryContextResetChildren work similarly, but that
> doesn't work because if we're not removing child contexts then we
> need extra state to tell which ones we've done already.  For the
> same reason my idea for bounding the stack space needed by
> MemoryContextStats doesn't seem to work.  We could possibly make it
> work if we were willing to add a temporary-use pointer field to all
> MemoryContext headers, but I'm unconvinced that'd be a good tradeoff.

For removing recursion from memory context processing, please check
the patch by Heikki [1], and my slightly revised version [2].

Links.
1. https://www.postgresql.org/message-id/6b48c746-9704-46dc-b9be-01fe4137c824%40iki.fi
2. https://www.postgresql.org/message-id/CAPpHfdtQVzkKgrxqKZE9yESnu7cAATVQbGktVOSXPNWG7GOkhA%40mail.gmail.com

------
Regards,
Alexander Korotkov



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Record returning function accept not matched columns declaration
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #18380: BUG: notify stops working after LEFT JOIN if enable_mergejoin is ON