Re: Assertion failure in get_appendrel_parampathinfo

From: Elvis Pranskevichus <elprans(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Assertion failure in get_appendrel_parampathinfo
Date: 2014-09-17 22:58:26
Message-ID: 1525103.aHpcLfUgAm@klinga.prans.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yeah, it crashes on debug build with asserts enabled when
planning.

In fact, it's possible to reproduce on a smaller query:

EXPLAIN SELECT
True
FROM
link
INNER JOIN (SELECT id FROM b
UNION ALL SELECT id FROM d) AS v
ON (link.target = v.id);

On non-debug build EXPLAIN works, but running it crashes in
ExecEvalScalarVar:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000596dd5 in ExecEvalScalarVar ()
(gdb) bt
#0 0x0000000000596dd5 in ExecEvalScalarVar ()
#1 0x00000000005a4f98 in ExecIndexEvalRuntimeKeys ()
#2 0x00000000005a66e8 in ExecReScanIndexOnlyScan ()
#3 0x000000000059057d in ExecReScan ()
#4 0x00000000005a66a5 in ExecIndexOnlyScan ()
#5 0x0000000000594498 in ExecProcNode ()
#6 0x000000000059f57f in ExecAppend ()
#7 0x00000000005944e8 in ExecProcNode ()
#8 0x00000000005aab87 in ExecNestLoop ()
#9 0x0000000000594408 in ExecProcNode ()
#10 0x0000000000591aa0 in standard_ExecutorRun ()
#11 0x0000000000678aa8 in PortalRunSelect ()
#12 0x0000000000679e2f in PortalRun ()
#13 0x0000000000677bc3 in PostgresMain ()
#14 0x000000000046adef in main ()

Elvis

On September 17, 2014 02:50:34 PM Tom Lane wrote:
> Elvis Pranskevichus <elprans(at)gmail(dot)com> writes:
> > Postgres 9.4beta2 and later crashes given the following
query:
> Thanks for the test case. Reproduces for me in HEAD, will
> look into it later.
>
> > Which generates the following query plan:
> I'm a bit confused about your statement that it produces this
> query plan, since AFAICS it crashes before getting that far.
>
> regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-09-18 00:10:52 Re: BUG #11335: an invalid prepare statement causes crash at log_statement = 'mod' or 'ddl'.
Previous Message Andres Freund 2014-09-17 21:58:57 Re: BUG #11335: an invalid prepare statement causes crash at log_statement = 'mod' or 'ddl'.