[geos-devel] GEOS cross-heap problems

Paul Ramsey pramsey at opengeo.org
Tue May 12 17:03:15 EDT 2009


Frank,

Please feel free to add the patch into trunk.

Regarding API additions, I am feeling a little conservative. At a
minimum, once you start doing that, all the downstream packages have
to start testing for revision in order to know if they can call the
feature.

I'd like to hear from others on this.

On a related note, strk has completed a large run through upgrading
GEOS to the latest JTS, which has added some extra robustness to a
number of cases, and he's also tracked and killed some long-standing
bugs. A GEOS 3.2 would not be a bad thing to have, rather than letting
the functionality moulder in SVN. (This would also be a fine place for
API changes)

P.

On Tue, May 12, 2009 at 1:47 PM, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Frank Warmerdam wrote:
>>
>> Folks,
>>
>> I had a serious problem reported by a client of mine. The issue turned out
>> to be that the OSGeo4W GEOS package was built with a different version of
>> visual studio than the OSGeo4W GDAL package.  The GDAL package calls:
>>
>>    pabyBuf = GEOSGeomToWKB_buf( geosGeom, &nSize );
>>    ...
>>    free( pabyBuf );
>>
>> The problem is that the buffer allocated by GEOS c-runtime is being freed
>> with the free() of the GDAL c-runtime resulting in heap corruption.
>>
>> For things like geometry and coordinate sequences we have special
>> deallocators available as part of the GEOS C API.  However this is not
>> the case (as far as I know) for plain malloc()/free() type stuff.
>>
>> So my questions are:
>>
>>  1) Am I missing an existing GEOSFree() function?
>
> Folks,
>
> Howard has pointed out that this is already a known issue, listed in:
>
>  http://trac.osgeo.org/geos/ticket/249
>
> I see Paul has "accepted" the ticket, but I don't see any sign that it
> has been incorporated.  Also, what constraints do we have on backporting
> an API *addition* like this?
>
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>


More information about the geos-devel mailing list