pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix alignment in BRIN minmax-multi deserialization
Date: Fri, 26 Mar 2021 15:53:38 +0000
Message-ID: <E1lPomI-0000CO-Mn@gemulon.postgresql.org> (raw)

Fix alignment in BRIN minmax-multi deserialization

The deserialization failed to ensure correct alignment, as it assumed it
can simply point into the serialized value. The serialization however
ignores alignment and copies just the significant bytes in order to make
the result as small as possible. This caused failures on systems that
are sensitive to mialigned addresses, like sparc, or with address
sanitizer enabled.

Fixed by copying the serialized data to ensure proper alignment. While
at it, fix an issue with serialization on big endian machines, using the
same store_att_byval/fetch_att trick as extended statistics.

Discussion: https://postgr.es/0c8c3304-d3dd-5e29-d5ac-b50589a23c8c%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/73b96bad4af8fd113a36e4633dd3312001c115dc

Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 87 ++++++++++++++++++++++++-----
1 file changed, 74 insertions(+), 13 deletions(-)



Message-ID: <E1lPomI-0000CO-Mn@gemulon.postgresql.org>
Permalink:  ../E1lPomI-0000CO-Mn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lPomI-0000CO-Mn@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: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Fix alignment in BRIN minmax-multi deserialization
  In-Reply-To: <E1lPomI-0000CO-Mn@gemulon.postgresql.org>
  References: <E1lPomI-0000CO-Mn@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