[postgis-devel] st_union segfault

Michael Fuhr mike at fuhr.org
Thu Aug 2 08:08:50 PDT 2007


The following query crashes the backend with a segmentation fault:

select st_union(st_makeline(st_makepoint(i, 0), st_makepoint(i + 1, 0)))
  from generate_series(1, 17) as g(i);

The following query doesn't crash; the only difference is in the
second argument to generate_series():

select st_union(st_makeline(st_makepoint(i, 0), st_makepoint(i + 1, 0)))
  from generate_series(1, 16) as g(i);

System info:

PostgreSQL 8.2.4 on i386-unknown-freebsd6.2, compiled by GCC gcc (GCC) 3.4.6 [FreeBSD] 20060305
POSTGIS="1.3.0RC4" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel. 4.5.0, 22 Oct 2006" USE_STATS

Stack trace:

#0  0x2db512da in yComparator (a=0x40220000, b=0x84114c0) at STRtree.cpp:43
#1  0x2db50c6f in std::__unguarded_partition<__gnu_cxx::__normal_iterator<geos::index::strtree::Boundable**, std::vector<geos::index::strtree::Boundable*, std::allocator<geos::index::strtree::Boundable*> > >, geos::index::strtree::Boundable*, bool (*)(geos::index::strtree::Boundable*, geos::index::strtree::Boundable*)> (__first={_M_current = 0x8415b44}, __last={_M_current = 0x8415b44}, __pivot=0x84114c0, 
    __comp=0x2db512b0 <yComparator>) at stl_iterator.h:614
#2  0x2db50fa5 in std::__introsort_loop<__gnu_cxx::__normal_iterator<geos::index::strtree::Boundable**, std::vector<geos::index::strtree::Boundable*, std::allocator<geos::index::strtree::Boundable*> > >, int, bool (*)(geos::index::strtree::Boundable*, geos::index::strtree::Boundable*)> (__last={_M_current = 0x8415b44}, __depth_limit=7, __comp=0x2db512b0 <yComparator>) at stl_algo.h:121
#3  0x2db5184d in geos::index::strtree::STRtree::sortBoundables (this=0xbfbfca74, input=0x8411410) at stl_algo.h:759
#4  0x2db51ce4 in geos::index::strtree::STRtree::createParentBoundables (this=0xbfbfca74, childBoundables=0x8411410, newLevel=0) at memory:366
#5  0x2db4efdc in geos::index::strtree::AbstractSTRtree::createHigherLevels (this=0xbfbfca74, boundablesOfALevel=0x8411410, level=-1) at memory:366
#6  0x2db4ecbf in geos::index::strtree::AbstractSTRtree::build (this=0xbfbfca74) at stl_vector.h:427
#7  0x2db4ec07 in geos::index::strtree::AbstractSTRtree::query (this=0xbfbfca74, searchBounds=0x84135a0, matches=@0xbfbfc970) at AbstractSTRtree.cpp:123
#8  0x2db63352 in geos::noding::MCIndexNoder::intersectChains (this=0xbfbfca60) at STRtree.h:129
#9  0x2db63550 in geos::noding::MCIndexNoder::computeNodes (this=0xbfbfca60, inputSegStrings=0xbfbfcc70) at MCIndexNoder.cpp:54
#10 0x2db6110a in geos::noding::FastNodingValidator::checkInteriorIntersections (this=0xbfbfcc88) at FastNodingValidator.cpp:41
#11 0x2db6143b in geos::noding::FastNodingValidator::checkValid (this=0xbfbfcc88) at FastNodingValidator.h:108
#12 0x2db87605 in geos::operation::overlay::OverlayOp::computeOverlay (this=0xbfbfcd60, opCode=geos::operation::overlay::OverlayOp::opUNION) at EdgeNodingValidator.h:81
#13 0x2db876cc in geos::operation::overlay::OverlayOp::getResultGeometry (this=0xbfbfcd60, funcCode=geos::operation::overlay::OverlayOp::opUNION) at OverlayOp.cpp:186
#14 0x2db8770d in geos::operation::overlay::OverlayOp::overlayOp (geom0=0x83c82c0, geom1=0x8414e20, opCode=geos::operation::overlay::OverlayOp::opUNION) at OverlayOp.cpp:92
#15 0x2da78eb8 in geos::geom::BinaryOp<geos::operation::overlay::overlayOp> (g0=0x83c82c0, g1=0x8414e20) at OverlayOp.h:337
#16 0x2da76695 in GEOSUnion (g1=0x83c82c0, g2=0x8414e20) at OverlayOp.h:333
#17 0x2da3aca1 in unite_garray (fcinfo=0xbfbfd010) at lwgeom_geos_c.c:180
#18 0x08134280 in finalize_aggregate (aggstate=0x8411410, peraggstate=0x83fe8d8, pergroupstate=0x83fe960, resultVal=0x83fe8b8, resultIsNull=0x83fe8c8 "") at nodeAgg.c:595
#19 0x0813450b in ExecAgg (node=0x83fa2a8) at nodeAgg.c:965
#20 0x0812bb9c in ExecProcNode (node=0x83fa2a8) at execProcnode.c:409
#21 0x0812a13a in ExecutorRun (queryDesc=0x83fa2a8, direction=ForwardScanDirection, count=0) at execMain.c:1082
#22 0x081a694b in PortalRunSelect (portal=0x83f5018, forward=-64 'À', count=0, dest=0x83a69e0) at pquery.c:831
#23 0x081a6fc0 in PortalRun (portal=0x83f5018, count=2147483647, dest=0x83a69e0, altdest=0x83a69e0, completionTag=0xbfbfd710 "") at pquery.c:684
#24 0x081a30d9 in exec_simple_query (query_string=0x83a6018 "select st_union(st_makeline(st_makepoint(i, 0), st_makepoint(i + 1, 0))) from generate_series(1, 17) as g(i);") at postgres.c:939
#25 0x081a53bb in PostgresMain (argc=4, argv=0x83427f0, username=0x8342770 "mfuhr") at postgres.c:3424
#26 0x08181203 in ServerLoop () at postmaster.c:2932
#27 0x08182742 in PostmasterMain (argc=3, argv=0xbfbfec8c) at postmaster.c:966
#28 0x081487d6 in main (argc=3, argv=0xbfbfec8c) at main.c:188

-- 
Michael Fuhr



More information about the postgis-devel mailing list