[postgis-devel] Some sort of memory leak?

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Wed Dec 17 11:57:05 PST 2008


Obe, Regina wrote:

> This one I'm not quite sure how to describe as a bug but it seems to be
> a long standing problem (happens on my 1.3.3 install so certainly
> nothing we should rush to fix).
> 
> Haven't tested on 1.4
> 
> This works --
> 
> SELECT ST_AsEWKT(ST_LineToCurve(ST_Buffer(ST_Point(i,j), j)))  As
> the_geom 
> 		FROM generate_series(-10,50,10) As i 
> 			CROSS JOIN generate_series(40,70, 20) As j
> 
> 
> This works --
> SELECT ST_Collect(ST_LineToCurve(ST_Buffer(ST_Point(i,j), j)))  As
> the_geom 
> 		FROM generate_series(-10,50,10) As i 
> 			CROSS JOIN generate_series(40,70, 20) As j
> 
> But this crashes server sometimes (not all the time).
> 
> SELECT ST_AsEWKT(ST_LineToCurve(ST_Buffer(ST_Point(i,j), j)))  As
> the_geom 
> 		FROM generate_series(-10,50,10) As i 
> 			CROSS JOIN generate_series(40,70, 20) As j
> 
> 
> This most often crashes but doesn't seem to on fresh restart
> SELECT ST_AsEWKT(ST_Collect(the_geom)),
> 	ST_AsEWKT(ST_Collect(ST_Multi(the_geom)))
> 		  
> 		FROM ((SELECT ST_LineToCurve(ST_Buffer(ST_Point(i,j),
> j))  As the_geom 
> 		FROM generate_series(-10,50,10) As i 
> 			CROSS JOIN generate_series(40,70, 20) As j)) As
> foo; 
> 
> In case anyone is interested, attached is the latest torture script
> compressed.

Right. After a lot of sweat and tears, I think I finally got this one - 
at least your original torture script now carries on until it crashes on 
the CIRCULARSTRING distance test (GBT#85).

It was caused by a couple of the collection functions for MULTISURFACEs 
and COMPOUNDCURVEs iterating directly through the sub-geometries without 
checking for optional information such as SRID and BBOX. So if you 
didn't have a SRID/BBOX in your sub-geometries then the tests would pass 
without any issue...


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-devel mailing list