Re: PostgreSQL crashes with SIGSEGV - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: PostgreSQL crashes with SIGSEGV
Date
Msg-id CAH2-Wz=QW6FNpLEfQpFKmKiu_WkfxCpmPDmp6ZUf=7SrARsNpQ@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL crashes with SIGSEGV  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: PostgreSQL crashes with SIGSEGV  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
On Mon, Feb 12, 2018 at 6:15 PM, Peter Geoghegan <pg@bowt.ie> wrote:
> * For 9.5 and 9.6, the approach taken in bugfix commit d8589946d
> should be taken even further -- we should always copy. Moreover, we
> should always copy within tuplesort_getdatum(), for the same reasons.
>
> * For 9.5, 9.6, 10, and master, we should make sure that
> tuplesort_getdatum() uses the caller's memory context. The fact that
> it doesn't already do so seems like a simple oversight. We should do
> this to be consistent with tuplesort_gettupleslot(). (This isn't
> critical, but seems like a good idea.)
>
> * For 9.5, 9.6, 10, and master, we should adjust some comments from
> tuplesort_getdatum() callers, so that they no longer say that
> tuplesort datum tuple memory lives in tuplesort context. That won't be
> true anymore.

Attached patches do it that way. I'm happy with what I came up with,
which is a lot simpler than my first approach. The extra copying seems
likely to be well worth it, since it is fairly isolated in practice,
especially on 9.6. There is no extra copying from v10+, since they
don't need the first fix at all.

-- 
Peter Geoghegan

Attachment

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Translations contributions urgently needed
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Translations contributions urgently needed