Re: Overflow hazard in pgbench

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Overflow hazard in pgbench
Date: 2021-06-28 16:43:30
Message-ID: 253122.1624898610@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
>> I suggest applying the attached in branches that have the required
>> functions.

> The proposed patch does fix the issue in pgbench TAP test. I'd suggest to
> add unlikely() on all these conditions, as already done elsewhere. See
> attached version.

Done that way, though I'm skeptical that it makes any measurable
difference.

> I also recompiled after removing manually -fwrapv: Make check, pgbench TAP
> tests and check-world all passed. I'm not sure that edge case are well
> enough tested in postgres to be sure that all is ok just from these runs
> though.

Yeah, I'm afraid that in most places it'd take a specifically-designed
test case to expose a problem, if there is one.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-06-28 16:45:10 Re: Unbounded %s in sscanf
Previous Message Julien Rouhaud 2021-06-28 16:41:47 Re: Deparsing rewritten query