Re: Assertion failure in get_appendrel_parampathinfo - Mailing list pgsql-bugs

From Elvis Pranskevichus
Subject Re: Assertion failure in get_appendrel_parampathinfo
Date
Msg-id 1525103.aHpcLfUgAm@klinga.prans.org
Whole thread Raw
In response to Re: Assertion failure in get_appendrel_parampathinfo  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@gmail.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

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #11335: an invalid prepare statement causes crash at log_statement = 'mod' or 'ddl'.
Next
From: Tom Lane
Date:
Subject: Re: BUG #11335: an invalid prepare statement causes crash at log_statement = 'mod' or 'ddl'.