pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix alignment problem with bbsink_copystream buffer.
Date: Wed, 19 Jan 2022 13:16:06 +0000
Message-ID: <E1nAAoo-0003Li-VA@gemulon.postgresql.org> (raw)

Fix alignment problem with bbsink_copystream buffer.

bbsink_copystream wants to store a type byte just before the buffer,
but basebackup.c wants the buffer to be aligned so that it can call
PageIsNew() and PageGetLSN() on it. Therefore, instead of inserting
1 extra byte before the buffer, insert MAXIMUM_ALIGNOF extra bytes
and only use the last one.

On most machines this doesn't cause any problem (except perhaps for
performance) but some buildfarm machines with -fsanitize=alignment
dump core.

Discussion: http://postgr.es/m/CA+TgmoYx5=1A2K9JYV-9zdhyokU4KKTyNQ9q7CiXrX=YBBMWVw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0f47e833bf6d96c1a2c5173c8e0f6c6cc30f9592

Modified Files
--------------
src/backend/replication/basebackup_copy.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)



Message-ID: <E1nAAoo-0003Li-VA@gemulon.postgresql.org>
Permalink:  ../E1nAAoo-0003Li-VA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nAAoo-0003Li-VA@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: Fix alignment problem with bbsink_copystream buffer.
  In-Reply-To: <E1nAAoo-0003Li-VA@gemulon.postgresql.org>
  References: <E1nAAoo-0003Li-VA@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