agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Noah Misch <noah@leadboat.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Robert Treat <rob@xzilla.net>
Subject: Re: Adding REPACK [concurrently]
Date: Tue, 07 Apr 2026 11:35:50 +0200
Message-ID: <193024.1775554550@localhost> (raw)
In-Reply-To: <202604070916.5rj6kvjx3mrk@alvherre.pgsql>
References: <202604070916.5rj6kvjx3mrk@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

> On 2026-Apr-07, Antonin Houska wrote:
> 
> > I haven't thought of this explanation because BufFileWrite() only copies the
> > data to a buffer in the BufFile structure and BufFileDumpBuffer() writes the
> > buffer. Maybe valgrind is able to track the copying?
> 
> Yeah, apparently it keeps track of tainted bytes somehow.  Clever.
> 
> The change to palloc0() that I was proposing did not fix the problem,
> because the stack allocated struct overwrote those zeroes with the
> uninitialized padding bytes.
> 
> I ended up with an equivalent fix to Srinath's -- zero-initializing
> the stack-allocated struct, so that the bytes that end up copied by
> memcpy() are all defined.  Srinath confirmed that in his environment the
> valgrind failure goes away, so I think we're good.

Thanks!

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com





view thread (416+ messages)  latest in thread

Message-ID: <193024.1775554550@localhost>
Permalink:  ../193024.1775554550@localhost/
Also on:    postgresql.org/message-id/193024.1775554550@localhost

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-hackers@postgresql.org
  Cc: ah@cybertec.at, alvherre@alvh.no-ip.org, srinath2133@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de, noah@leadboat.com, vignesh21@gmail.com, amit.kapila16@gmail.com, mihailnikalayeu@gmail.com, boekewurm+postgres@gmail.com, pgsql-hackers@lists.postgresql.org, rob@xzilla.net
  Subject: Re: Adding REPACK [concurrently]
  In-Reply-To: <193024.1775554550@localhost>

* 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