Re: BUG #14344: string_agg(DISTINCT ..) crash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14344: string_agg(DISTINCT ..) crash
Дата
Msg-id 22270.1475163646@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #14344: string_agg(DISTINCT ..) crash  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: BUG #14344: string_agg(DISTINCT ..) crash
Список pgsql-bugs
Peter Geoghegan <pg@heroku.com> writes:
> I see what the problem is. This use-after-free bug occurs because, for
> some reason, tuplesort_gettupleslot()'s contract was not updated by me
> alongside analogous routines like tuplesort_getindextuple() as part of
> the batch memory commit. This meant that at least one particular case
> (process_ordered_aggregate_multi() calls to tuplesort_gettupleslot(),
> with distinct columns) felt entitled to reuse some slot's tuple, a
> tuple located in memory managed by tuplesort.c as batch memory.

My immediate reaction to this is WTF.  It seems like you have completely
broken the expected contract of tuplesort_gettupleslot, which is that
it copies the data into caller-owned memory.  That cannot stand.  Even
if you are willing to hack all the core callers so that they no longer
expect that, you've probably broken --- subtly --- callers in extensions.

            regards, tom lane

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: BUG #14344: string_agg(DISTINCT ..) crash
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: BUG #14344: string_agg(DISTINCT ..) crash