Re: Consistent segfault in complex query

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyle Samson <kysamson@tripadvisor.com>, "pgsql-hackers\@postgresql.org" <pgsql-hackers@postgresql.org>, Matthew Kelly <mkelly@tripadvisor.com>
Date: 2018-09-14T02:23:34Z
Lists: pgsql-hackers

Attachments

>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> Your other idea of forcing initPlan parameters to be evaluated
 >> before we enter the EPQ execution environment is probably more
 >> workable.

 Tom> Concretely, the attached seems to be enough to fix it (though I
 Tom> only tried the simplest case you posted).

If it helps, here is a patch that adds isolation tests to
eval-plan-qual.spec for two test cases (one with CTE, one without).
I've verified that these reproduce the crash, and that they run
successfully with your patch. I can't currently see any more specific
code paths to probe in these tests.

-- 
Andrew (irc:RhodiumToad)

Commits

  1. Fix failure with initplans used conditionally during EvalPlanQual rechecks.