pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: digoal@126.com, PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14668: BRIN open autosummarize=on , database will crash
Date: Tue, 30 May 2017 18:19:55 -0400
Message-ID: <20170530221955.cdldd7bz77neabi5@alvherre.pgsql> (raw)
In-Reply-To: <CAEepm=3LqJUjaHOb_CeH+KuNUhmNhxztd+Sn6DN5PhPdDK_JTQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Thomas Munro wrote:

> I guess brin_free_tuple(lastPageTuple) should only be called if it's
> not NULL, so I guess brin.c lacks an "else" here:
> 
> -                       brin_free_tuple(lastPageTuple);
> +                       else
> +                               brin_free_tuple(lastPageTuple);
> 
> It doesn't crash for me with that change.

Pushed fix.  Actually that's not correct either, because tuples returned
by brinGetTupleForHeapBlock are not supposed to be freed at all since
they are shared buffer items.  The correct thing to do there was to
release the buffer lock ...

Thanks for the report and analysis.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <20170530221955.cdldd7bz77neabi5@alvherre.pgsql>
Permalink:  ../20170530221955.cdldd7bz77neabi5@alvherre.pgsql/
Also on:    postgresql.org/message-id/20170530221955.cdldd7bz77neabi5@alvherre.pgsql

 · 

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-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, thomas.munro@enterprisedb.com
  Subject: Re: BUG #14668: BRIN open autosummarize=on , database will crash
  In-Reply-To: <20170530221955.cdldd7bz77neabi5@alvherre.pgsql>
  References: <CAEepm=3LqJUjaHOb_CeH+KuNUhmNhxztd+Sn6DN5PhPdDK_JTQ@mail.gmail.com> <20170530221955.cdldd7bz77neabi5@alvherre.pgsql>

* 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