Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior
Ranier Vilela <ranier.vf@gmail.com>
From: Ranier Vilela <ranier.vf@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Noah Misch <noah@leadboat.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-08-28T13:37:08Z
Lists: pgsql-hackers
Em sex., 28 de ago. de 2020 às 00:11, Tom Lane <tgl@sss.pgh.pa.us> escreveu: > > In other words, the C standard made a damfool decision and now we need > to deal with the consequences of that as perpetrated by other fools. > Still, it's all hypothetical so far --- does anyone have examples of > actual rather than theoretical issues? > I still think the value of this alert would be to avoid the call. Why do memcmp have to deal with a NULL value? clog.c: 299, it is a case outside the curve, there are hundreds of calls in the report. It must be very difficult to correct, but if TransactionIdSetPageStatus was not called in these cases, memcmp, it would not have to deal with the NULL pointer. regards, Ranier Vilela
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