[postgis-tickets] [PostGIS] #2732: gserialized_estimate crashes under mingw64 windows when compiled with --enabled-debug

PostGIS trac at osgeo.org
Mon May 12 14:29:06 PDT 2014


#2732: gserialized_estimate crashes under mingw64 windows when compiled with
--enabled-debug
------------------------------+---------------------------------------------
 Reporter:  robe              |       Owner:  pramsey      
     Type:  defect            |      Status:  new          
 Priority:  medium            |   Milestone:  PostGIS 2.1.3
Component:  postgis           |     Version:  2.1.x        
 Keywords:  windows, mingw64  |  
------------------------------+---------------------------------------------

Comment(by robe):

 okay patched line 820 with:


 {{{
 POSTGIS_DEBUGF(2, "stats for \"%s\" do not exist",
 get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL");
 }}}

 and yeh another break somewhere else on line 1181


 {{{
 (gdb) bt
 #0  0x000007fefe545a01 in strlen () from C:\Windows\system32\msvcrt.dll
 #1  0x000000000074df39 in fmtstr (target=0x23cc700, pointflag=<optimized
 out>, maxwidth=0, minlen=0, leftjust=0, value=0x0) at snprintf.c:779
 #2  dopr (target=target at entry=0x23cc700, format=0x3eb143 "\" Oid(%d)",
 args=0x23cc838 "", args at entry=0x23cc818 "\005£") at snprintf.c:714
 #3  0x000000000074e13f in pg_vsnprintf (str=<optimized out>,
 count=count at entry=1023, fmt=fmt at entry=0x3eb118 "[%s:%s:%d] unable to
 retrieve stats for \"%s\" Oid(%d)", args=args at entry=0x23cc818 "\005£") at
 snprintf.c:154
 #4  0x000000000057c0b1 in appendStringInfoVA (str=str at entry=0x23cc7c0,
 fmt=fmt at entry=0x3eb118 "[%s:%s:%d] unable to retrieve stats for \"%s\"
 Oid(%d)", args=args at entry=0x23cc818 "\005£") at stringinfo.c:137
 #5  0x000000000071607f in errmsg_internal (fmt=fmt at entry=0x6a00a740
 <my_finfo.69106+1140> "[%s:%s:%d] unable to retrieve stats for \"%s\"
 Oid(%d)") at elog.c:821
 #6  0x0000000069fa7657 in gserialized_gist_joinsel
 (fcinfo=fcinfo at entry=0x23cc8c0) at gserialized_estimate.c:1181
 #7  0x000000000071b9ab in DirectFunctionCall5Coll
 (func=func at entry=0x69fa7330 <gserialized_gist_joinsel>,
 collation=collation at entry=0, arg1=<optimized out>, arg2=<optimized out>,
 arg3=62832304, arg4=0, arg5=arg5 at entry=2) at fmgr.c:1133
 #8  0x0000000069faa7b5 in gserialized_gist_joinsel_2d (fcinfo=<optimized
 out>) at gserialized_estimate.c:1109
 #9  0x000000000071caef in OidFunctionCall5Coll (functionId=<optimized
 out>, collation=collation at entry=0, arg1=arg1 at entry=62686056,
 arg2=arg2 at entry=22743, arg3=arg3 at entry=62832304, arg4=arg4 at entry=0,
 arg5=arg5 at entry=37541088) at fmgr.c:1714
 #10 0x00000000005de350 in join_selectivity (root=root at entry=0x3bc8368,
 operatorid=operatorid at entry=22743, args=0x3bebeb0, inputcollid=0,
 jointype=jointype at entry=JOIN_INNER, sjinfo=sjinfo at entry=0x23cd4e0) at
 plancat.c:1082
 #11 0x00000000005abaf9 in clause_selectivity (root=root at entry=0x3bc8368,
 clause=0x3bebdd8, clause at entry=0xe670c08, varRelid=varRelid at entry=0,
 jointype=jointype at entry=JOIN_INNER, sjinfo=sjinfo at entry=0x23cd4e0) at
 clausesel.c:659
 #12 0x00000000005abd68 in clauselist_selectivity (root=0x3bc8368,
 clauses=<optimized out>, varRelid=varRelid at entry=0,
 jointype=jointype at entry=JOIN_INNER, sjinfo=sjinfo at entry=0x23cd4e0) at
 clausesel.c:123
 #13 0x00000000005ac690 in calc_joinrel_size_estimate
 (root=root at entry=0x3bc8368, outer_rows=1, inner_rows=1,
 sjinfo=sjinfo at entry=0x23cd4e0, restrictlist=restrictlist at entry=0xe679980)
 at costsize.c:3645
 #14 0x00000000005b0578 in set_joinrel_size_estimates
 (root=root at entry=0x3bc8368, rel=rel at entry=0xe6794c8,
 outer_rel=outer_rel at entry=0x3bee7c8, inner_rel=inner_rel at entry=0x3beea18,
 sjinfo=sjinfo at entry=0x23cd4e0, restrictlist=restrictlist at entry=0xe679980)
 at costsize.c:3531
 #15 0x00000000005e050a in build_join_rel (root=root at entry=0x3bc8368,
 joinrelids=joinrelids at entry=0xe679308,
 outer_rel=outer_rel at entry=0x3bee7c8, inner_rel=inner_rel at entry=0x3beea18,
 sjinfo=0x23cd4e0, restrictlist_ptr=restrictlist_ptr at entry=0x23cd4d8) at
 relnode.c:426
 #16 0x00000000005b9c56 in make_join_rel (root=root at entry=0x3bc8368,
 rel1=rel1 at entry=0x3bee7c8, rel2=rel2 at entry=0x3beea18) at joinrels.c:634
 #17 0x00000000005ba579 in make_rels_by_clause_joins (other_rels=<optimized
 out>, old_rel=<optimized out>, root=<optimized out>) at joinrels.c:274
 #18 join_search_one_level (root=root at entry=0x3bc8368, level=level at entry=2)
 at joinrels.c:96
 #19 0x00000000005ab15f in standard_join_search (root=0x3bc8368,
 levels_needed=2, initial_rels=<optimized out>) at allpaths.c:1569
 #20 0x00000000005ab29c in make_rel_from_joinlist (root=0x3bc8368,
 joinlist=<optimized out>) at allpaths.c:1465
 #21 0x00000000005ab29c in make_rel_from_joinlist (root=0x3bc8368,
 joinlist=<optimized out>) at allpaths.c:1465
 #22 0x00000000005ab4e9 in make_one_rel (root=root at entry=0x3bc8368,
 joinlist=joinlist at entry=0xe673c98) at allpaths.c:143
 #23 0x00000000005c6012 in query_planner (root=root at entry=0x3bc8368,
 tlist=tlist at entry=0x3be7b80, tuple_fraction=tuple_fraction at entry=40,
 limit_tuples=-1, qp_callback=qp_callback at entry=0x5c6bb0
 <standard_qp_callback>, qp_extra=qp_extra at entry=0x23cd930,
 cheapest_path=cheapest_path at entry=0x23cd920,
     sorted_path=sorted_path at entry=0x23cd928,
 num_groups=num_groups at entry=0x23cd918) at planmain.c:261
 #24 0x00000000005c72fd in grouping_planner (root=root at entry=0x3bc8368,
 tuple_fraction=40, tuple_fraction at entry=0) at planner.c:1207
 #25 0x00000000005c9bc9 in subquery_planner (glob=0xe040920,
 parse=0x3ba2a58, parent_root=parent_root at entry=0xdfde690,
 hasRecursion=<optimized out>, tuple_fraction=tuple_fraction at entry=0,
 subroot=subroot at entry=0x23cdb58) at planner.c:558
 #26 0x00000000005cea30 in SS_process_ctes (root=root at entry=0xdfde690) at
 subselect.c:1061
 #27 0x00000000005c96e1 in subquery_planner (glob=glob at entry=0xe040920,
 parse=parse at entry=0xdf4ceb0, parent_root=parent_root at entry=0x0,
 hasRecursion=hasRecursion at entry=0 '\000', tuple_fraction=0,
 subroot=subroot at entry=0x23cdc88) at planner.c:328
 #28 0x00000000005c9f02 in standard_planner (parse=0xdf4ceb0,
 cursorOptions=0, boundParams=0x48f3e48) at planner.c:209
 #29 0x0000000000640f59 in pg_plan_query (querytree=<optimized out>,
 cursorOptions=cursorOptions at entry=0,
 boundParams=boundParams at entry=0x48f3e48) at postgres.c:753
 #30 0x000000000064108b in pg_plan_queries
 (querytrees=querytrees at entry=0xdfe07d8, cursorOptions=0,
 boundParams=boundParams at entry=0x48f3e48) at postgres.c:812
 #31 0x0000000000705b76 in BuildCachedPlan
 (plansource=plansource at entry=0xdf35e18, qlist=0xdfe07d8, qlist at entry=0x0,
 boundParams=boundParams at entry=0x48f3e48) at plancache.c:907
 #32 0x0000000000705db7 in GetCachedPlan
 (plansource=plansource at entry=0xdf35e18,
 boundParams=boundParams at entry=0x48f3e48, useResOwner=useResOwner at entry=0
 '\000') at plancache.c:1166
 #33 0x000000000057a1fa in SPI_cursor_open_internal (name=name at entry=0x0,
 plan=plan at entry=0x23cdef0, paramLI=paramLI at entry=0x48f3e48,
 read_only=read_only at entry=1 '\001') at spi.c:1277
 #34 0x000000000057a70c in SPI_cursor_open_with_args (name=name at entry=0x0,
     src=src at entry=0xdd9cde0 "\n    WITH \n      a1 AS (SELECT f.*,
 addr.fromhn, addr.tohn, addr.side , addr.zip\n
 FROM (SELECT * FROM featnames \n
 WHERE statefp = $1 AND ( lower(name) = $2   or  lower(fullname) L
  $"..., nargs=<optimized out>, argtypes=0xdd9de50, Values=0xdd9dea8,
 Nulls=0xdd9cd08 "         ~\177\177\177\177\177\177àiZ\004", read_only=1
 '\001', cursorOptions=cursorOptions at entry=0) at spi.c:1171
 #35 0x000000006984d59e in exec_dynquery_with_params
 (estate=estate at entry=0x23ce360, dynquery=<optimized out>,
 params=<optimized out>, portalname=portalname at entry=0x0,
 cursorOptions=cursorOptions at entry=0) at pl_exec.c:6427
 #36 0x000000006984f325 in exec_stmt_dynfors (stmt=0xdb8f910,
 estate=0x23ce360) at pl_exec.c:3606
 #37 exec_stmt (stmt=0xdb8f910, estate=0x23ce360) at pl_exec.c:1454
 #38 exec_stmts (estate=0x23ce360, stmts=<optimized out>) at pl_exec.c:1345
 #39 0x0000000069851921 in exec_stmt_block (estate=0x0,
 estate at entry=0x23ce360, block=0x48f1f50) at pl_exec.c:1283
 #40 0x0000000069851b8d in plpgsql_exec_function (func=0x48e6c10,
 func at entry=0x23ce890, fcinfo=0x23ce890, fcinfo at entry=0x23ce5a8) at
 pl_exec.c:321
 #41 0x0000000069846dd8 in plpgsql_call_handler (fcinfo=0x23ce5a8) at
 pl_handler.c:129
 #42 0x000000000071d862 in fmgr_security_definer (fcinfo=0x200000000) at
 fmgr.c:975
 #43 0x000000000055ac5d in ExecMakeTableFunctionResult (funcexpr=0x49405a8,
 econtext=0x48ec038, expectedDesc=0x48eda88, randomAccess=0 '\000') at
 execQual.c:2167
 #44 0x000000000056ed97 in FunctionNext (node=0x48ebf20) at
 nodeFunctionscan.c:64
 #45 0x000000000055ce49 in ExecScanFetch (recheckMtd=0x56ed20
 <FunctionRecheck>, accessMtd=0x56ed30 <FunctionNext>, node=0x48ebf20) at
 execScan.c:82
 #46 ExecScan (node=node at entry=0x48ebf20,
 accessMtd=accessMtd at entry=0x56ed30 <FunctionNext>,
 recheckMtd=recheckMtd at entry=0x56ed20 <FunctionRecheck>) at execScan.c:167
 #47 0x000000000056edc3 in ExecFunctionScan (node=node at entry=0x48ebf20) at
 nodeFunctionscan.c:107
 #48 0x0000000000555898 in ExecProcNode (node=node at entry=0x48ebf20) at
 execProcnode.c:426
 #49 0x0000000000552a0c in ExecutePlan (dest=0x49e9bd0,
 direction=<optimized out>, numberTuples=0, sendTuples=1 '\001',
 operation=CMD_SELECT, planstate=0x48ebf20, estate=0x48ebe08) at
 execMain.c:1470
 #50 standard_ExecutorRun (queryDesc=0xdb81a38, direction=<optimized out>,
 count=0) at execMain.c:306
 #51 0x00000000006441a6 in PortalRunSelect (portal=portal at entry=0x48cfd28,
 forward=forward at entry=1 '\001', count=count at entry=0,
 dest=dest at entry=0x48cfd28) at pquery.c:946
 #52 0x0000000000645876 in PortalRun (portal=0x23ceea0,
 portal at entry=0x48cfd28, count=0, count at entry=2147483647,
 isTopLevel=isTopLevel at entry=0 '\000', dest=0x48cfd28,
 dest at entry=0x49e9bd0, altdest=altdest at entry=0x49e9bd0,
 completionTag=0x23cf220 "",
     completionTag at entry=0x40000000088 <Address 0x40000000088 out of
 bounds>) at pquery.c:790
 #53 0x0000000000643146 in exec_simple_query (query_string=0x7fefe543fc0
 <msvcrt!__iob_func> "H\215\005\271ê\a") at postgres.c:1048
 #54 PostgresMain (argc=<optimized out>, argv=argv at entry=0x3ea850,
 dbname=0x17 <Address 0x17 out of bounds>, username=<optimized out>) at
 postgres.c:3985
 #55 0x00000000005f6b41 in BackendRun (port=0x23cf410) at postmaster.c:3999
 #56 SubPostmasterMain (argc=argc at entry=3, argv=argv at entry=0x257de0) at
 postmaster.c:4504
 #57 0x000000000075fb29 in main (argc=3, argv=0x257de0) at main.c:173
 (gdb)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2732#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list