Re: Handling memory contexts in aggregate function invoking other built-in aggregate functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Handling memory contexts in aggregate function invoking other built-in aggregate functions
Дата
Msg-id 2693283.1638648255@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Handling memory contexts in aggregate function invoking other built-in aggregate functions  (Matt Magoffin <postgresql.org@msqr.us>)
Ответы Re: Handling memory contexts in aggregate function invoking other built-in aggregate functions  (Matt Magoffin <postgresql.org@msqr.us>)
Список pgsql-general
Matt Magoffin <postgresql.org@msqr.us> writes:
> On 5/12/2021, at 5:16 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Are you testing in an --enable-cassert build?  If not, do that;
>> it might make the cause of the crashes more apparent, thanks to
>> CLOBBER_FREED_MEMORY and other debug support.

> I did build with --enable-cassert, and I did see the state argument pointer passed to numeric_avg_accum
>  as 0x7f7f7f7f7f, so now I understand why that was thanks to seeing the information about what that means on the Dev
FAQ,thanks for that. 

So that probably means that you weren't careful about allocating your
own state data in the long-lived context (agg_context), and so it
got freed between calls.

            regards, tom lane



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

Предыдущее
От: Matt Magoffin
Дата:
Сообщение: Re: Handling memory contexts in aggregate function invoking other built-in aggregate functions
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: libpq: Which functions may hang due to network issues?