pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Avoid valgrind complaint about write() of uninitalized bytes.
Date: Tue, 06 Feb 2018 19:25:04 +0000
Message-ID: <E1ej8rY-0005fo-9e@gemulon.postgresql.org> (raw)

Avoid valgrind complaint about write() of uninitalized bytes.

LogicalTapeFreeze() may write out its first block when it is dirty but
not full, and then immediately read the first block back in from its
BufFile as a BLCKSZ-width block.  This can only occur in rare cases
where very few tuples were written out, which is currently only
possible with parallel external tuplesorts.  To avoid valgrind
complaints, tell it to treat the tail of logtape.c's buffer as
defined.

Commit 9da0cc35284bdbe8d442d732963303ff0e0a40bc exposed this problem
but did not create it.  LogicalTapeFreeze() has always tended to write
out some amount of garbage bytes, but previously never wrote less than
one block of data in total, so the problem was masked.

Per buildfarm members lousyjack and skink.

Peter Geoghegan, based on a suggestion from Tom Lane and me.  Some
comment revisions by me.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9fafa413ac602624e10f61ef44a20c17029d43d8

Modified Files
--------------
src/backend/utils/sort/logtape.c | 12 ++++++++++++
1 file changed, 12 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1ej8rY-0005fo-9e@gemulon.postgresql.org>
Permalink:  ../E1ej8rY-0005fo-9e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ej8rY-0005fo-9e@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Avoid valgrind complaint about write() of uninitalized bytes.
  In-Reply-To: <E1ej8rY-0005fo-9e@gemulon.postgresql.org>
  References: <E1ej8rY-0005fo-9e@gemulon.postgresql.org>

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

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