pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@heroku.com>
Cc: Euler Taveira <euler@timbira.com.br>
Cc: Jihyun Yu <yjh0502@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14134: segmentation fault with large table with gist index
Date: Sun, 05 Jun 2016 11:54:56 -0400
Message-ID: <560.1465142096@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM3SWZRnGLAO-OkBnQB686HKfGPBbHfCeSrJOajT-Wh9a_tVkQ@mail.gmail.com>
References: <20160511154904.2603.43889@wrigleys.postgresql.org>
	<57336236.3060200@timbira.com.br>
	<CAM3SWZTrnui1h0yJW+idbSxQFpOU5yrHjrpr0D-aELs5==tM9A@mail.gmail.com>
	<CAM3SWZRnGLAO-OkBnQB686HKfGPBbHfCeSrJOajT-Wh9a_tVkQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Peter Geoghegan <pg@heroku.com> writes:
> My previous analysis on why this occurred so infrequently as to only
> see a problem report months after a stable release was wrong. This bug
> only happens in narrow situations where a distance function exists
> that is indexable by GiST, while that also lacks SortSupport. GiST
> isn't doing anything with any other SortSupport attribute that lacks a
> distance operator.

> The lack of SortSupport will make SortSupport use a shim comparator,
> which tries to use caller's memory context, which was found to be NULL
> (since we palloc0()). So, this bug is fairly narrow in practice,
> because you had to be using the distance operator for interval, which
> looks like the only example of where this is possible.

> Attached patch fixes the bug by initializing the SortSupport states used.

Pushed.  I added an explicit initialization of orderbysort->abbreviate,
because all the other callers of PrepareSortSupportFromOrderingOp make
a point of setting that.  Also a regression test.

			regards, tom lane


-- 
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 (8+ messages)  latest in thread

Message-ID: <560.1465142096@sss.pgh.pa.us>
Permalink:  ../560.1465142096@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/560.1465142096@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, pg@heroku.com, euler@timbira.com.br, yjh0502@gmail.com
  Subject: Re: BUG #14134: segmentation fault with large table with gist index
  In-Reply-To: <560.1465142096@sss.pgh.pa.us>
  References: <20160511154904.2603.43889@wrigleys.postgresql.org> <57336236.3060200@timbira.com.br> <CAM3SWZTrnui1h0yJW+idbSxQFpOU5yrHjrpr0D-aELs5==tM9A@mail.gmail.com> <CAM3SWZRnGLAO-OkBnQB686HKfGPBbHfCeSrJOajT-Wh9a_tVkQ@mail.gmail.com> <560.1465142096@sss.pgh.pa.us>

* 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