[geos-devel] CVS PrecisionModel segfault on Windows MSVC 7.1

Howard Butler hobu at iastate.edu
Mon Jan 23 16:54:17 EST 2006


All,

I'm having trouble with a MSVC 7.1- compiled version of GEOS where 
I'm attempting to buffer a geometry that was defined with this wkt:

LINESTRING (2.000000000000 1.000000000000, 1.000000000000 3.000000000000)

I am using 30.0 as my buffer distance (using 3.0 also causes a 
segfault in the same spot).

Here is the stack trace of my segfault:

> 
>_geos_d.pyd!geos::PrecisionModel::makePrecise(geos::Coordinate * 
>coord=0x0021a1e8)  Line 137 + 0x3      C++
>         _geos_d.pyd!geos::OffsetCurveBuilder::addPt(const 
> geos::Coordinate & pt={...})  Line 198        C++
>         _geos_d.pyd!geos::OffsetCurveBuilder::addLastSegment() 
> Line 315        C++
> 
>_geos_d.pyd!geos::OffsetCurveBuilder::computeLineBufferCurve(const 
>geos::CoordinateSequence * inputPts=0x00b6f980)  Line 165    C++
>         _geos_d.pyd!geos::OffsetCurveBuilder::getLineCurve(const 
> geos::CoordinateSequence * inputPts=0x00b6f980, double 
> distance=30.000000000000000)  Line 95   C++
> 
>_geos_d.pyd!geos::OffsetCurveSetBuilder::addLineString(const 
>geos::LineString * line=0x00a4dfe0)  Line 152 + 0x1b       C++
>         _geos_d.pyd!geos::OffsetCurveSetBuilder::add(const 
> geos::Geometry * g=0x00a4dfe0)  Line 105     C++
>         _geos_d.pyd!geos::OffsetCurveSetBuilder::getCurves()  Line 54   C++
>         _geos_d.pyd!geos::BufferBuilder::buffer(geos::Geometry * 
> g=0x00a4dfe0, double distance=30.000000000000000)  Line 111 + 0x8      C++
>         _geos_d.pyd!geos::BufferOp::bufferOriginalPrecision()  Line 
> 206 + 0x1a  C++
>         _geos_d.pyd!geos::BufferOp::computeGeometry()  Line 169 C++
>         _geos_d.pyd!geos::BufferOp::getResultGeometry(double 
> nDistance=30.000000000000000)  Line 132    C++
>         _geos_d.pyd!geos::BufferOp::bufferOp(geos::Geometry * 
> g=0x00a4dfe0, double distance=30.000000000000000)  Line 75 + 0x1c C++
>         _geos_d.pyd!geos::Geometry::buffer(double 
> distance=30.000000000000000)  Line 543 + 0x12 C++
>         _geos_d.pyd!_wrap_Geometry_buffer__SWIG_0(_object * 
> __formal=0x00000000, _object * args=0x00aec338)  Line 10283 + 0x14  C++
>         _geos_d.pyd!_wrap_Geometry_buffer(_object * 
> self=0x00000000, _object * args=0x00aec338)  Line 10357 + 0xd       C++

The code at that location is:

>void PrecisionModel::makePrecise(Coordinate *coord) const {
>     // optimization for full precision
>         if (modelType==FLOATING) return;
>         coord->x=makePrecise(coord->x);
>         coord->y=makePrecise(coord->y);
>}

and when I inspect modelType with the debugger.  It isn't 
anything.  Grepping through the source code, I noticed that a lot of 
the modelType==FOO throughout PrecisionModel.cpp have been commented 
out.  The CVS log doesn't show that anything has changed much in 
quite a while though.  Anyone have any idea what might be going on so 
that modelType isn't initialized?

Thanks

Howard 




More information about the geos-devel mailing list