Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole[local] SELECT: double free or corruption (!pre

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole[local] SELECT: double free or corruption (!pre
Дата
Msg-id CAH2-Wz=RDFQAqczdFezYCuyEHid4eHe6e5uEu1cVsFg7t4Hsyw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole[local] SELECT: double free or corruption (!pre  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole [local] SELECT: double free or corruption (!pre  (Vitaly V. Voronov <wizard_1024@tut.by>)
Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole [local] SELECT: double free or corruption (!pre  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Mon, Apr 16, 2018 at 10:48 AM, Alvaro Herrera
<alvherre@alvh.no-ip.org> wrote:
> and tuplestore_end does this:
>         if (state->myfile)
>                 BufFileClose(state->myfile);
> without setting anything in state to NULL; so we're relying on the
> caller fs->tstore to null to avoid repeated tuplestore_end calls.  I
> can't see any way for this to misbehave, but maybe the funcstate appears
> more than once in the PerFuncState array, and we clean it correctly the
> first time around and then invoke the tuplestore_end() the second time
> to the memory that was previously freed?  I think this makes no sense
> unless we share FunctionScanPerFuncState elements -- do we?

I have no reason to think that we do. Offhand, I find it more likely
that some executor slot that imagines that it owns the tuple frees the
tuple once, which is followed by a call to tuplestore_end() that frees
the same tuple a second time (a double-free). As I mentioned, we've
seen several bugs of that general variety in both tuplestore and
tuplesort in the past. Some of these have been very subtle.

Note that pgpool is involved here. I don't know much about pgpool, and
maybe that's totally irrelevant.

-- 
Peter Geoghegan


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

Предыдущее
От: Emre Hasegeli
Дата:
Сообщение: Re: Wrong Results from SP-GiST with Collations
Следующее
От: Vitaly V. Voronov
Дата:
Сообщение: Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole [local] SELECT: double free or corruption (!pre