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

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon May 21 09:50:10 PDT 2007


On Sat, 2007-05-19 at 07:04 -0600, Michael Fuhr wrote:
> On Sat, May 19, 2007 at 08:31:54AM +0100, Mark Cave-Ayland wrote:
> > 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.
> 
> First byte or first 32-bit word?  It's interesting that the code works
> -- at least to the extent that it passes the regression tests -- on 
> one of my platforms (big-endian sparc).

Yes, sorry - you are right, I meant the first 32-bit word of the varlena
structure.

> > 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.
> 
> I have access to all four combinations of 32-bit/64-bit big-endian/
> little-endian architectures; please let me know when you have
> something ready to test and I'll try it on all of them.

Brilliant. I've just posted a patch from SVN HEAD to my latest tree on
postgis-devel which passes all regression tests on 32-bit Linux here if
you would like to test.


Kind regards,

Mark.

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





More information about the postgis-users mailing list