Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Ranier Vilela <ranier.vf@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>, Noah Misch <noah@leadboat.com>
Date: 2020-08-31T19:38:51Z
Lists: pgsql-hackers
On Mon, Aug 31, 2020 at 11:42 AM Andres Freund <andres@anarazel.de> wrote: > Unsigned integer overflow is well defined in the standard. So I don't understand what this is purporting to warn about. Presumably it's simply warning that the value -4294901760 (i.e. the result of 3 - 4294901763) cannot be faithfully represented as an unsigned int. This is true, of course. It's just not relevant. I'm pretty sure that UBSan does not actually state that this is undefined behavior. At least Ranier's sample output didn't seem to indicate it. -- Peter Geoghegan
Commits
-
Avoid memcpy() with a NULL source pointer and count == 0
- f0ff52f25cb9 12.6 landed
- 677f74e5bb83 14.0 landed
- 5a1d1b9540a4 13.2 landed
- 49aaabdf8d0b 11.11 landed
-
Avoid calling memcpy() with a NULL source pointer and count == 0.
- 13bba02271dc 9.6.0 cited