agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix valgrind failure
Date: Tue, 7 Apr 2026 15:29:34 +0200
Message-ID: <202604071325.oar274bbljbq@alvherre.pgsql> (raw)
In-Reply-To: <adTRZrIyZjAhFj9h@ip-10-97-1-34.eu-west-3.compute.internal>

Hello,

On 2026-Apr-07, Bertrand Drouvot wrote:

> -       SerializedSnapshotData serialized_snapshot;
> +       SerializedSnapshotData serialized_snapshot = {0};
> 
> Should we use memset() instead? As "= {0}" is guaranteed to zero padding bytes
> (for object that has automatic storage duration) as of C23 (see Andres's reply
> in [0]) but we require C11 so far.

Hmm ... I'll wait for skink to fail with the fix that was committed,
before making further changes.  It may well be that it works okay as it
is now.

> I wonder if we should introduce a new macro say "INITIALIZE_PADDING"
> that I proposed in [1].
> 
> [1]: https://postgr.es/m/ablMZvnGhX8h5GgK%40ip-10-97-1-34.eu-west-3.compute.internal

It's not clear to me how that would be used exactly (surely it needs to
be part of the initialization? But what if you have to use memset?), but
the idea looks rather ugly.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/





view thread (3+ messages)

Message-ID: <202604071325.oar274bbljbq@alvherre.pgsql>
Permalink:  ../202604071325.oar274bbljbq@alvherre.pgsql/
Also on:    postgresql.org/message-id/202604071325.oar274bbljbq@alvherre.pgsql

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@kurilemu.de, bertranddrouvot.pg@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix valgrind failure
  In-Reply-To: <202604071325.oar274bbljbq@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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