Re: BUG #14208: Inconsistent code modification - 3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: petrum(at)gmail(dot)com
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14208: Inconsistent code modification - 3
Date: 2016-06-22 15:45:16
Message-ID: 31897.1466610316@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

petrum(at)gmail(dot)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?
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.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maxim Sobolev 2016-06-22 15:47:30 Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD
Previous Message Tom Lane 2016-06-22 15:15:03 Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD