Re: BUG #14208: Inconsistent code modification - 3

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: BUG #14208: Inconsistent code modification - 3
Дата
Msg-id 20160623225301.4v7heuiyvkfwi5ev@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: BUG #14208: Inconsistent code modification - 3  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #14208: Inconsistent code modification - 3  ("petrum@gmail.com" <petrum@gmail.com>)
Re: BUG #14208: Inconsistent code modification - 3  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On 2016-06-22 11:45:16 -0400, Tom Lane wrote:
> petrum@gmail.com writes:
> > File: postgresql-9.4.4/src/backend/replication/logical/reorderbuffer.c
> > Function: ReorderBufferInterTXNInit
> > Line: 870
>
> > The line is
> > if (txn->nentries != txn->nentries_mem)
> > But shouldn't be there cur_txn instead of txn?
>
> Actually, the function is ReorderBufferIterTXNInit, and in HEAD this
> is line 963, but yeah that looks pretty broken.  Andres, do you
> concur?

Ugh, yes, that looks broken. In a way that can very likely lead to wrong
data being returned :(. I assume an empty toplevel transaction +
subtransactions with spilled-to-disk contents will be bad.


> Or maybe the logic needs to be different for subtransactions?
>
> > I do not know exactly the semantics of the code because I detected the
> > problem with a CodeSonar prototype plugin.
>
> Seems like a cool tool.

Indeed. What heuristic lead to detecting this? I can think of some, but
they all owuld have significant false-positive rates.

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

Предыдущее
От: jie.long@pega.com
Дата:
Сообщение: BUG #14212: DB crash: system logger process was terminated by exception 0xFFFFFFFFwith exception 0xFFFFFFFF
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14210: filter by "=" constraint doesn't work when hash index is present on a column