[postgis-users] Re: [postgis-devel] Moving towards a 1.2.2 release?

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat May 19 00:31:54 PDT 2007


On Fri, 2007-05-18 at 22:11 -0600, Michael Fuhr wrote:
> On Fri, May 18, 2007 at 06:29:23PM -0600, Michael Fuhr wrote:
> > I'll see if I can figure out why the patch works on the big-endian
> > sparc but not on the little-endian x86, or if the patch's problem
> > isn't endianness but rather some other difference between the
> > platforms.
> 
> Any ideas why the following happens?  What might the patch be doing
> incorrectly?
> 
> SELECT GeomFromText('POINT(11 22)');
>  geomfromtext 
> --------------
>  0100000000
> (1 row)
> 
> In a working PostGIS/PostgreSQL 8.2.4 on the same platform (x86
> 32-bit) the output is:
> 
> SELECT GeomFromText('POINT(11 22)');
>                 geomfromtext                
> --------------------------------------------
>  010100000000000000000026400000000000003640
> (1 row)


Hi Mike,

I've had a quick look at this, and the news is not great. Basically
there are multiple places in the code that write directly to the first
byte of a varlena structure rather than using the PostgreSQL VAR*
macros. Since the first byte of a varlena is not longer just an integer
representing its length but a "packed" pointer, it cause PostgreSQL to
either use an incorrect size or dereference an incorrect pointer which
causes the crash.

I've started looking at this, but it's impossible to do via search and
replace. I'm currently running through the regression tests and
correcting the places one-by-one as they either return an incorrectly
sized string or crash the backend. Yuck.


Kind regards,

Mark.

-- 
ILande - Open Source Consultancy
http://www.ilande.co.uk





More information about the postgis-users mailing list