pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tomas Vondra <tomas.vondra@postgresql.org>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Add support for multivariate MCV lists
Date: Fri, 29 Mar 2019 19:20:13 +0100
Message-ID: <20190329182013.GB8733@development> (raw)
In-Reply-To: <20190328193711.GC16397@development>
References: <E1h9DoH-0004Bn-4N@gemulon.postgresql.org>
	<20190327190406.3gmupkthnbx7lvho@alap3.anarazel.de>
	<CAH2-Wzn8qvKsw3bgixXymQ6CAHTA3Vofw7vCUAFV0qGcTmkerg@mail.gmail.com>
	<20190327201346.GB21957@development>
	<20190327203353.GC21957@development>
	<20190328012752.GD4406@development>
	<CAH2-Wzn8oZqSK1rZ2Hvn1v9SeXZ-YsrTq-2kX3p+zW8bPFgaZQ@mail.gmail.com>
	<20190328183336.GB16397@development>
	<20190328193711.GC16397@development>

On Thu, Mar 28, 2019 at 08:37:11PM +0100, Tomas Vondra wrote:
>On Thu, Mar 28, 2019 at 07:33:36PM +0100, Tomas Vondra wrote:
>>On Thu, Mar 28, 2019 at 11:29:12AM -0700, Peter Geoghegan wrote:
>>>On Wed, Mar 27, 2019 at 6:27 PM Tomas Vondra
>>><tomas.vondra@2ndquadrant.com> wrote:
>>>>It's a bit too late for pushing emergency fixes over here, so I'll do
>>>>more testing tomorrow and then push.
>>>
>>>The buildfarm is still almost all-red now. Can you estimate how long
>>>it will take to push a fix?
>>>
>>
>>Half an hour, at most. I have a fix and I'm running tests on it to make
>>sure it does break something else.
>>
>
>OK, I've pushed the fix. As explained in the commit message, the
>deserialization was borked in two ways. Firstly, it was vulnerable to
>use-after-free. Secondly, the serialization/deserialization of data for
>by-value types did not work for bigendian systems.
>
>I believe this should fix prion (which was tripping on the first issue,
>due to using -DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE) and at
>least some of the bigendian boxes (I've tested it on s390x).
>

OK, this apparently worked fine for all x86 and s390 machines.

>
>I do think there's one remaining issue - the deserialized value is
>allocated as a single chunk, and is then "sliced" into smaller buffers.
>But the code ignores alignment, which I think may trigger SIGBUS on some
>platforms - for example grison, skate or gull fail like this, and those
>are ARMv7 and sparc machines.
>
>I do have a fix for that too, but I decided not to push it yet before
>testing it a bit more.
>

I've pushed a fix for this. The short version is that the serialized
representation was not respecting memory alignment requirements, which was
causing issues in machines sensitive to this (ia64, sparc, hppa). It's a
blind attempt, as I currently don't have access to any such machine.

FWIW I've pushed this now so that the machines can test the other stuff,
like jsonpath. I think the serialization/deserialization would deserve a
second look, and I'm wondering if it should work more like ArrayType (i.e.
relying on att_align_* instead of explicit MAXALIGN).

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services






view thread (16+ messages)  latest in thread

Message-ID: <20190329182013.GB8733@development>
Permalink:  ../20190329182013.GB8733@development/
Also on:    postgresql.org/message-id/20190329182013.GB8733@development

 · 

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@2ndquadrant.com, pg@bowt.ie, andres@anarazel.de, tomas.vondra@postgresql.org
  Subject: Re: pgsql: Add support for multivariate MCV lists
  In-Reply-To: <20190329182013.GB8733@development>
  References: <E1h9DoH-0004Bn-4N@gemulon.postgresql.org> <20190327190406.3gmupkthnbx7lvho@alap3.anarazel.de> <CAH2-Wzn8qvKsw3bgixXymQ6CAHTA3Vofw7vCUAFV0qGcTmkerg@mail.gmail.com> <20190327201346.GB21957@development> <20190327203353.GC21957@development> <20190328012752.GD4406@development> <CAH2-Wzn8oZqSK1rZ2Hvn1v9SeXZ-YsrTq-2kX3p+zW8bPFgaZQ@mail.gmail.com> <20190328183336.GB16397@development> <20190328193711.GC16397@development> <20190329182013.GB8733@development>

* 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