[postgis-devel] Re: geometry stats

strk strk at keybit.net
Thu Feb 26 08:29:11 PST 2004


m.cave-ayland wrote:
> Hi strk,
> 
> >	/*
> > #if DEBUG_GEOMETRY_STATS > 1
> >	{
> >		int x, y;
> >		for (x=0; x<bps; x++)
> >		{
> >			for (y=0; y<bps; y++)
> >			{
> >				geomstats->value[i] = 0;
> 				
> 				^^^^^^^^^^^^^^^^^^^^^^^^
> This causes your segfault because it is writing outside allocated
> palloc'd memory. Is this supposed to set the last value of the histogram
> to be 0? (remember this is outside the normalisation loop). The cure is
> either to remove this line, or change it to:
> 
> 				geomstats->value[i - 1] = 0;

Actually that line is useless :)
I removed it.

> Hope this helps! Keep up the good work!

Thank you.

--strk;



More information about the postgis-devel mailing list