[postgis-devel] Re: [postgis-users] Performance and memory problems

strk strk at keybit.net
Fri Dec 5 03:39:17 PST 2003


I've reproduced the bug with local data.
It shows up with both PG7.4 and PG7.3.
Converting a GeometryCollection from GEOS format to PostGIS format
randomly segfaults.

I've noticed that in my cases (2 cases detected) the number of geometries
in the collection is bigger then 4 (so are the number of recursions). 

I've controlled that pfree'd addresses are not zero and that they're
returned by functions that would palloc them or return NULL.

I've verified that the suggested patch works (removing the pfree(r) line)
but it would be better to understand what's the problem is.

I've also tried substituting the DirectFunctionCall2 call with a real
direct call (making a collector_raw and changing collector to a wrapper 
to it), but the problem is still there.

I wonder if this might have to do with the recursion ...

--strk;

andrea.aime wrote:
> Andrea Aime wrote:
> 
> > Andrea Aime wrote:
> > 
> >> strk wrote:
> >>
> >>
> >>> Ask on the pgsql-hackers mailing list about postmaster
> >>> stack trace (and please let me know).
> >>>
> >>> --strk;
> >>>
> >>
> > 
> > I followed David directions and found what geometry makes
> > the thing crash:
> > 
> > NOTICE:  The geometry that makes it crash: LINESTRING 
> > (-161.1793670654300001
> > 66.2170028686523011, -161.1728210449219887 66.2185287475585938)
> > 
> 
> I really did not make sense, so I increased the debug output and found
> this:
> 
> NOTICE:  debugCounter = 2195, type = 7
> NOTICE:  Number of geometries 180
> NOTICE:  debugCounter = 2196, type = 2
> NOTICE:  debugCounter = 2197, type = 2
> NOTICE:  debugCounter = 2198, type = 2
> NOTICE:  debugCounter = 2199, type = 2
> NOTICE:  debugCounter = 2200, type = 2
> NOTICE:  The geometry that makes crash: LINESTRING (-161.1793670654300001
> 66.2170028686523011, -161.1728210449219887 66.2185287475585938)
> Segmentation fault (core dumped)
> 
> Ha, it's a geometry collection that makes it crash! By the way, it's not
> the first non empty collection, there are other two (I also added a counter
> for this while writing this mail).
> 
> Best regards
> Andrea Aime
> 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-devel mailing list