Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 065621FE8DA for ; Wed, 25 Jan 2012 18:14:01 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RqB6N-0007Um-K5 for pgsql-bugs@postgresql.org; Wed, 25 Jan 2012 22:14:01 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q0PMDiL0012621; Wed, 25 Jan 2012 17:13:44 -0500 (EST) To: Phil Sorber cc: pgsql-bugs@postgresql.org Subject: Re: Segfault in backend CTE code In-reply-to: References: <20955.1327383788@sss.pgh.pa.us> <6418.1327438984@sss.pgh.pa.us> Comments: In-reply-to Phil Sorber message dated "Wed, 25 Jan 2012 12:47:06 -0500" Date: Wed, 25 Jan 2012 17:13:44 -0500 Message-ID: <12620.1327529624@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/169 X-Sequence-Number: 32236 Phil Sorber writes: > That helped a lot. I now have a simple test case that I can reliably > re-produce the segfault and now also a patch that fixes it. [ pokes at that... ] Hmm. I think what this proves is that that optimization in EvalPlanQualStart is just too cute for its own good, and that the only safe fix is to take it out. That code path is (obviously) none too well tested, so we should not have it setting up execution tree structures that are not like those used normally. It's just begging for trouble. regards, tom lane