pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Phil Sorber <phil@omniti.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Segfault in backend CTE code
Date: Tue, 24 Jan 2012 16:03:04 -0500
Message-ID: <6418.1327438984@sss.pgh.pa.us> (raw)
In-Reply-To: <CADAkt-h=ut28S_k1zWzyx+-qdHAahOB24LUMA5z5QoF3WVppBQ@mail.gmail.com>
References: <CADAkt-iWfSvovEMd4-sT15OQ+YK4FC_YbZDefxwUK5EwrWe4bA@mail.gmail.com>
	<20955.1327383788@sss.pgh.pa.us>
	<CADAkt-h=ut28S_k1zWzyx+-qdHAahOB24LUMA5z5QoF3WVppBQ@mail.gmail.com>

Phil Sorber <phil@omniti.com> writes:
> On Tue, Jan 24, 2012 at 12:43 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> How about a test case?

> We are having trouble coming up with a test case that can reliably
> reproduce this.

The stack traces run through the EvalPlanQual machinery, which is only
going to be entered when attempting to update/delete a row that's been
updated by a concurrent transaction.  So what I'd suggest for creating a
test case is

	(1) in a psql session, do
		BEGIN;
		UPDATE some-target-row;

	(2) in another psql session, call this function with arguments
	    that will make it try to update that same row; it should
	    block.

	(3) in the first session, COMMIT to unblock.

FWIW, having re-examined your patch with some caffeine in me, I don't
think it's right at all.  You can't just blow off setting the scan type
for a CTEScan node.  What it looks like to me is that the EvalPlanQual
code is not initializing the new execution tree correctly; but that
idea would be a lot easier to check into with a test case.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <6418.1327438984@sss.pgh.pa.us>
Permalink:  ../6418.1327438984@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6418.1327438984@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, phil@omniti.com
  Subject: Re: Segfault in backend CTE code
  In-Reply-To: <6418.1327438984@sss.pgh.pa.us>
  References: <CADAkt-iWfSvovEMd4-sT15OQ+YK4FC_YbZDefxwUK5EwrWe4bA@mail.gmail.com> <20955.1327383788@sss.pgh.pa.us> <CADAkt-h=ut28S_k1zWzyx+-qdHAahOB24LUMA5z5QoF3WVppBQ@mail.gmail.com> <6418.1327438984@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