[sqlsmith] Failed assertion at relnode.c

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[sqlsmith] Failed assertion at relnode.c

tushar1
Hi,

While running sqlsmith against 12devel, got the the following
assertion-  (issue is reproducible  on v10/v11 as well)

TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids,
required_outer))", File: "relnode.c", Line: 1521)

stack trace -

#0  0x00007f2a2f349277 in raise () from /lib64/libc.so.6
#1  0x00007f2a2f34a968 in abort () from /lib64/libc.so.6
#2  0x0000000000893727 in ExceptionalCondition
(conditionName=conditionName@entry=0xa44ae8
"!(bms_is_subset(appendrel->lateral_relids, required_outer))",
     errorType=errorType@entry=0x8e1de9 "FailedAssertion",
fileName=fileName@entry=0xa441e4 "relnode.c",
lineNumber=lineNumber@entry=1521) at assert.c:54
#3  0x00000000006f2e0c in get_appendrel_parampathinfo
(appendrel=appendrel@entry=0x7f2a300e0b10,
required_outer=required_outer@entry=0x0) at relnode.c:1521
#4  0x00000000006e7d1d in create_append_path (root=root@entry=0x0,
rel=rel@entry=0x7f2a300e0b10, subpaths=subpaths@entry=0x0,
partial_subpaths=partial_subpaths@entry=0x0,
     required_outer=required_outer@entry=0x0,
parallel_workers=parallel_workers@entry=0,
parallel_aware=parallel_aware@entry=false,
partitioned_rels=partitioned_rels@entry=0x0,
     rows=rows@entry=-1) at pathnode.c:1239
#5  0x00000000006a7fc7 in set_dummy_rel_pathlist
(rel=rel@entry=0x7f2a300e0b10) at allpaths.c:1976
#6  0x00000000006a95e9 in set_subquery_pathlist (rte=<optimized out>,
rti=2, rel=0x7f2a300e0b10, root=0x29975e0) at allpaths.c:2162
#7  set_rel_size (root=root@entry=0x29975e0,
rel=rel@entry=0x7f2a300e0b10, rti=rti@entry=2, rte=<optimized out>) at
allpaths.c:422
#8  0x00000000006ab1ed in set_base_rel_sizes (root=<optimized out>) at
allpaths.c:324
#9  make_one_rel (root=root@entry=0x29975e0,
joinlist=joinlist@entry=0x7f2a300e1e88) at allpaths.c:186
#10 0x00000000006cad5d in query_planner (root=root@entry=0x29975e0,
tlist=tlist@entry=0x7f2a300e0608, qp_callback=qp_callback@entry=0x6cb920
<standard_qp_callback>,
     qp_extra=qp_extra@entry=0x7ffc93d63d20) at planmain.c:265
#11 0x00000000006cf3ac in grouping_planner (root=root@entry=0x29975e0,
inheritance_update=inheritance_update@entry=false,
tuple_fraction=<optimized out>, tuple_fraction@entry=0)
     at planner.c:1933
#12 0x00000000006d1b85 in subquery_planner (glob=glob@entry=0x29beb88,
parse=parse@entry=0x29be638, parent_root=parent_root@entry=0x0,
hasRecursion=hasRecursion@entry=false,
     tuple_fraction=tuple_fraction@entry=0) at planner.c:1001
#13 0x00000000006d2e36 in standard_planner (parse=0x29be638,
cursorOptions=256, boundParams=0x0) at planner.c:417
#14 0x000000000078793d in pg_plan_query
(querytree=querytree@entry=0x29be638,
cursorOptions=cursorOptions@entry=256,
boundParams=boundParams@entry=0x0) at postgres.c:878
#15 0x0000000000787a1e in pg_plan_queries (querytrees=<optimized out>,
cursorOptions=cursorOptions@entry=256,
boundParams=boundParams@entry=0x0) at postgres.c:968
#16 0x0000000000787eba in exec_simple_query (
     query_string=0x29979f8 "select\n  subq_1.c5 as c0\nfrom\n
pg_catalog.pg_description as ref_0,\n  lateral (select\n subq_0.c11 as
c0,\n        ref_0.objsubid as c1,\n ref_0.classoid as c2,\n       
ref_2.action_referen"...) at postgres.c:1143
#17 0x00000000007890d2 in PostgresMain (argc=<optimized out>,
argv=argv@entry=0x29c1300, dbname=0x29c1140 "postgres",
username=<optimized out>) at postgres.c:4256
#18 0x000000000047cee2 in BackendRun (port=<optimized out>,
port=<optimized out>) at postmaster.c:4399
#19 BackendStartup (port=0x29b9120) at postmaster.c:4090
#20 ServerLoop () at postmaster.c:1703
#21 0x00000000007105ff in PostmasterMain (argc=argc@entry=3,
argv=argv@entry=0x2991ce0) at postmaster.c:1376
#22 0x000000000047e083 in main (argc=3, argv=0x2991ce0) at main.c:228
(gdb) q

Query -
====

select
   subq_1.c5 as c0
from
   pg_catalog.pg_description as ref_0,
   lateral (select
         subq_0.c11 as c0,
         ref_0.objsubid as c1,
         ref_0.classoid as c2,
         ref_2.action_reference_new_row as c3,
         ref_4.opfmethod as c4,
         pg_catalog.pg_postmaster_start_time() as c5
       from
         pg_catalog.pg_prepared_statements as ref_1
             inner join information_schema.triggers as ref_2
               left join pg_catalog.pg_subscription_rel as ref_3
               on ((select idx_scan from pg_catalog.pg_stat_all_indexes
limit 1 offset 6)
                      > (select idx_blks_read from
pg_catalog.pg_statio_sys_indexes limit 1 offset 1)
                     )
             on (cast(null as macaddr) <= cast(null as macaddr))
           left join pg_catalog.pg_opfamily as ref_4
           on (ref_0.description is NULL),
         lateral (select
               ref_2.trigger_schema as c0,
               ref_2.action_reference_old_row as c1,
               ref_4.opfmethod as c2,
               ref_1.statement as c3,
               ref_0.objoid as c4,
               ref_2.action_reference_old_table as c5,
               ref_2.event_object_catalog as c6,
               ref_2.event_object_schema as c7,
               ref_2.trigger_catalog as c8,
               ref_0.description as c9,
               ref_4.opfname as c10,
               sample_0.stxname as c11
             from
               pg_catalog.pg_statistic_ext as sample_0 tablesample
system (2.7)
             where cast(null as point) @ cast(null as polygon)
             limit 105) as subq_0
       where (true)
         and ((ref_4.opfname is NULL)
           and (cast(null as int8) < ref_0.objsubid))) as subq_1
where subq_1.c5 is not NULL
limit 79;

--
regards,tushar
EnterpriseDB  https://www.enterprisedb.com/
The Enterprise PostgreSQL Company


Reply | Threaded
Open this post in threaded view
|

Re: [sqlsmith] Failed assertion at relnode.c

Amit Langote
On Thu, Mar 14, 2019 at 11:53 PM tushar <[hidden email]> wrote:

>
> Hi,
>
> While running sqlsmith against 12devel, got the the following
> assertion-  (issue is reproducible  on v10/v11 as well)
>
> TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids,
> required_outer))", File: "relnode.c", Line: 1521)
>
> stack trace -
>
> #0  0x00007f2a2f349277 in raise () from /lib64/libc.so.6
> #1  0x00007f2a2f34a968 in abort () from /lib64/libc.so.6
> #2  0x0000000000893727 in ExceptionalCondition
> (conditionName=conditionName@entry=0xa44ae8
> "!(bms_is_subset(appendrel->lateral_relids, required_outer))",
>      errorType=errorType@entry=0x8e1de9 "FailedAssertion",
> fileName=fileName@entry=0xa441e4 "relnode.c",
> lineNumber=lineNumber@entry=1521) at assert.c:54
> #3  0x00000000006f2e0c in get_appendrel_parampathinfo
> (appendrel=appendrel@entry=0x7f2a300e0b10,
> required_outer=required_outer@entry=0x0) at relnode.c:1521
> #4  0x00000000006e7d1d in create_append_path (root=root@entry=0x0,
> rel=rel@entry=0x7f2a300e0b10, subpaths=subpaths@entry=0x0,
> partial_subpaths=partial_subpaths@entry=0x0,
>      required_outer=required_outer@entry=0x0,
> parallel_workers=parallel_workers@entry=0,
> parallel_aware=parallel_aware@entry=false,
> partitioned_rels=partitioned_rels@entry=0x0,
>      rows=rows@entry=-1) at pathnode.c:1239
> #5  0x00000000006a7fc7 in set_dummy_rel_pathlist
> (rel=rel@entry=0x7f2a300e0b10) at allpaths.c:1976

Looks same as bug #15694 that Tom seems to be taking care of.

Thanks,
Amit

Reply | Threaded
Open this post in threaded view
|

Re: [sqlsmith] Failed assertion at relnode.c

Tom Lane-2
In reply to this post by tushar1
tushar <[hidden email]> writes:
> While running sqlsmith against 12devel, got the the following
> assertion-  (issue is reproducible  on v10/v11 as well)
> TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids,
> required_outer))", File: "relnode.c", Line: 1521)

Doesn't crash for me, but that's probably because I just fixed bug #15694,
which looks like the same thing.  Thanks for the report though!

                        regards, tom lane