pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Initialize unused ExprEvalStep fields.
3+ messages / 2 participants
[nested] [flat]

* pgsql: Initialize unused ExprEvalStep fields.
@ 2018-01-29 20:07  Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Andres Freund @ 2018-01-29 20:07 UTC (permalink / raw)
  To: pgsql-committers

Initialize unused ExprEvalStep fields.

ExecPushExprSlots didn't initialize ExprEvalStep's resvalue/resnull
steps as it didn't use them. That caused wrong valgrind warnings for
an upcoming patch, so zero-intialize.

Also zero-initialize all scratch ExprEvalStep's allocated on the
stack, to avoid issues with similar future omissions of non-critial
data.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fc96c6942551dafa6cb2a6000cbc9b20643e5db3

Modified Files
--------------
src/backend/executor/execExpr.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Initialize unused ExprEvalStep fields.
@ 2018-01-29 20:16  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2018-01-29 20:16 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers

Andres Freund <andres@anarazel.de> writes:
> Initialize unused ExprEvalStep fields.
> ExecPushExprSlots didn't initialize ExprEvalStep's resvalue/resnull
> steps as it didn't use them. That caused wrong valgrind warnings for
> an upcoming patch, so zero-intialize.

Check ...

> Also zero-initialize all scratch ExprEvalStep's allocated on the
> stack, to avoid issues with similar future omissions of non-critial
> data.

Dunno that that's a good idea; it will also serve to hide valid warnings.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Initialize unused ExprEvalStep fields.
@ 2018-01-29 20:33  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Andres Freund @ 2018-01-29 20:33 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

Hi,

On 2018-01-29 15:16:59 -0500, Tom Lane wrote:
> > Also zero-initialize all scratch ExprEvalStep's allocated on the
> > stack, to avoid issues with similar future omissions of non-critial
> > data.
> 
> Dunno that that's a good idea; it will also serve to hide valid warnings.

Possible, but I think it's more likely that new fields with default to
zero/NULL anyway. Zero initializing around allocations is a pretty
common thing in the PG codebase, so it does feel consistent to me.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-01-29 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-29 20:07 pgsql: Initialize unused ExprEvalStep fields. Andres Freund <andres@anarazel.de>
2018-01-29 20:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-01-29 20:33   ` Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox