pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Leif Jensen <leif@crysberg.dk>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Server process crash - Segmentation fault
Date: Wed, 07 May 2014 12:11:41 -0400
Message-ID: <29568.1399479101@sss.pgh.pa.us> (raw)
In-Reply-To: <12460598.10774.1399477600310.JavaMail.root@quick>
References: <12460598.10774.1399477600310.JavaMail.root@quick>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

Leif Jensen <leif@crysberg.dk> writes:
>    Here is a gdb dump of the backtrace at the server process crash. I have also included the code that generates these calls. As mentioned below this specific connection has been used many times before the crash. Also, we are aware of the thread caveat that only using a connection from one thread at a time. Therefore the "strange" connection name that includes both the process id and the thread id. This is for the code to make sure that a connection is only used in the thread it is meant to.

Hm.  The crash looks like it must be because ActiveSnapshot is null
(not set).  Since we're doing a FETCH, the active snapshot ought to
be the one saved for the cursor query by DECLARE CURSOR.  It looks
like the problem is that pquery.c only bothers to install that as the
active snapshot while calling ExecutorRun, but in this stack trace
we're in ExecutorRewind.

I wonder if it's a bad idea for ExecReScanLimit to be executing
user-defined expressions?  But it's been like that for awhile,
and I think we might have a hard time preserving the bounded-sort
optimization if we didn't do that.

Anyway the simple fix would be to ensure we install the query
snapshot as active before calling ExecutorRewind.

One interesting question is why this issue hasn't been seen before;
it seems like it'd not be that hard to hit.

			regards, tom lane


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



view thread (16+ messages)  latest in thread

Message-ID: <29568.1399479101@sss.pgh.pa.us>
Permalink:  ../29568.1399479101@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29568.1399479101@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, leif@crysberg.dk, adrian.klaver@aklaver.com, pgsql-general@postgresql.org
  Subject: Re: Server process crash - Segmentation fault
  In-Reply-To: <29568.1399479101@sss.pgh.pa.us>
  References: <12460598.10774.1399477600310.JavaMail.root@quick> <29568.1399479101@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