Re: Overflow hazard in pgbench
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-28T16:43:30Z
Lists: pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.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
Commits
-
Don't depend on -fwrapv semantics in pgbench's random() function.
- 01697e92a460 15.0 landed
- be567deb3ac9 13.4 landed
- 3fd334795e26 12.8 landed
- 203c5aaaba56 14.0 landed