Opened 12 years ago

Closed 5 years ago

#518 closed defect (fixed)

GEOS 3.3.2 crashes on MinGW64

Reported by: esseffe Owned by: geos-devel@…
Priority: major Milestone: 3.8.0
Component: Default Version: 3.3.2
Severity: Unassigned Keywords:
Cc:

Description

I'm Sandro Furieri, developer and maintainer of SpatiaLite. I noticed some nasty crash caused by the current GEOS 3.3.2 on Windows 7 (64 bit): I compiled GEOS using the MinGW64 compiler, but may well be that all these issues are caused by Win64 runtime libs and not by MinGW itself (not really sure about this).

Anyway, it's surely interesting to note that on the same identical platform, anything runs smoothly (no crash at all) when I build a 32 bit executable using MinGW32 and compiling the same identical sources. These are the issues I noticed on MinGW64:

issue #1:

./configure --host=x86_64-w64-mingw32
make
make check
--
Making check in xmltester
make[2]: Entering directory `/f/sviluppo-64/contribs/geos-3.3.2/tests/xmltester'

make  check-TESTS
make[3]: Entering directory `/f/sviluppo-64/contribs/geos-3.3.2/tests/xmltester'

>>>>>>>>>>>>>> XMLtester.exe crashes <<<<<<<<<<<<<<<<

FAIL: testrunner
==================
1 of 1 test failed
==================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory `/f/sviluppo-64/contribs/geos-3.3.2/tests/xmltester'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/f/sviluppo-64/contribs/geos-3.3.2/tests/xmltester'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/f/sviluppo-64/contribs/geos-3.3.2/tests'
make: *** [check-recursive] Error 1

please note: this issue seems similar to the one reported on ticket #509, but it's not identical. and in my case it works nicely when for MinGW 32 bit.

issue #2:
GEOSIsValid() crashes when examining this geometry:

LINESTRING(1 2, 1 2)

please note: this Linestring simply has two points, and both them have identical coordinates. on Linux32, Linux64 and Win32 the same op simply returns an error and some warning as expected.

issue #3:
GEOSIsValid() crashes again when examining this geometry:

POLYGON((10 10, 15 10, 15 10, 10 15, 10 10), (5 5, 20 5, 20 20, 5 20, 5 5))

please note: this Polygon is invalid, because the Interior Ring is completely outside the Exterior Ring. yet again, on Linux32, Linux64 and Win32 the same op works as expected.

bye Sandro

Change History (9)

comment:1 by robe, 12 years ago

Sandro,

Which gcc are you using in your MingW64. As I recall, I don't think I was getting make check errors on the MingW64 chain, just the newer MingW that comes packaged with I think 4.6.1. On the MingW64 I compiled geos with, it was something like 4.4.something but I haven't recently compiled on my newer MingW64 which is with gcc 4.5.something.

BTW -- thanks for the Mingw64 instructions :)

in reply to:  1 ; comment:2 by esseffe, 12 years ago

Hi Robe,

My MinGW64 reports: gcc version 4.6.1

bye Sandro

in reply to:  2 comment:3 by esseffe, 12 years ago

interesting to notice (and may be related to this ticket someway). the Windows own runtime (printf) represents NaN-values in a completely different way ("1.#QNAN", "-1.#INF") from the one adopted on linux ("nan"). please see: http://trac.osgeo.org/gdal/ticket/3576

that's not only: I noticed an odd inconsistency affecting some math C-APIs between 32 and 64 bit implementations on Win, e.g.:

MinGW32
-------------------------
p = pow(0, -3.6)
errno=34 [ERANGE, exactly as on Linux]
fpclassify(p)=1280 [FP_INFINITE]
MinGW64
-------------------------
p = pow(0, -3.6)
errno=0 [no error !!!!!!]
fpclassify(p)=1280 [FP_INFINITE]

anyway fpclassify() isn't natively supported by the Windows own runtime; it looks much more consistent and robust relying on win-specific _spclass() instead (and useful to support MSVC as well, not only MinGW).

bye Sandro

comment:4 by robe, 12 years ago

okay I upgraded my mingw64 to gcc 4.6.3 and now I'm experiencing crashing in xmltester.exe to. I'm pretty sure it was working fine on my 4.4.7 (or something like that). I'm going to roll back to that one or my 4.5 next to see if I get the same issue.

For me it fails here: this is running branch 3.3 r3574

terminate called after throwing an instance of 'geos::util::TopologyException'
  what():  TopologyException: found non-noded intersection between LINESTRING (-
105571 939969, -102895 939993) and LINESTRING (9485.36 770763, -102895 939993) a
t -102894.5562421389 939992.66927296668

comment:5 by robe, 12 years ago

I'm a bit confused where the xmltester comes into play. I switched back to my gcc 4.5.4 mingw64 and this is what make check gives me with r3574

===============================
  GEOS Test Suite Application
===============================

capi::GEOSBuffer: ....................
capi::GEOSContains: ...
capi::GEOSCoordSeq: ......
capi::GEOSGeomFromWKB: .....
capi::GEOSGeomToWKT: .............
capi::GEOSGeom_create: .......
capi::GEOSGeom_extractUniquePoints: ...
capi::GEOSIntersects: ...NOTICE: IllegalArgumentException: RobustDeterminant enc
ountered non-finite numbers
.NOTICE: IllegalArgumentException: RobustDeterminant encountered non-finite numb
ers
.
capi::GEOSLineStringPoint: ...
capi::GEOSOffsetCurve: ......
capi::GEOSOrientationIndex: ...........
capi::GEOSPolygonizeGetCutEdges: ..
capi::GEOSPreparedGeometry: ......
capi::GEOSRelateBoundaryNodeRule: .......NOTICE: Invalid boundary node rule 5
.
capi::GEOSRelatePatternMatch: .....NOTICE: IllegalArgumentException: Geometry is
 not lineal

capi::GEOSSharedPaths: ..NOTICE: IllegalArgumentException: Geometry is not linea
l
.
capi::GEOSSimplify: .
capi::GEOSSnap: ....
capi::GEOSUnaryUnion: ........
capi::GEOSWithin: ...
capi::GEOSisValidDetail: ..[3=F]...
geos::algorithm::Angle: ....
geos::algorithm::CGAlgorithms::computeOrientation: ..
geos::algorithm::CGAlgorithms::isCCW: .....
geos::algorithm::CGAlgorithms::isPointInRing: ..
geos::algorithm::CGAlgorithms::signedArea: ...
geos::algorithm::ConvexHull: .......
geos::algorithm::InteriorPointArea: .
geos::algorithm::PointLocator: ....
geos::algorithm::RobustLineIntersection: ..
geos::algorithm::RobustLineIntersector: .............
geos::algorithm::distace::DiscreteHausdorffDistance: ....
geos::geom::Coordinate: .........
geos::geom::CoordinateArraySequence: .................
geos::geom::CoordinateArraySequenceFactory: ....
geos::geom::CoordinateList: ..
geos::geom::Dimension: .....
geos::geom::Envelope: .........
geos::geom::Geometry::clone: .......
geos::geom::Geometry::covers: ...
geos::geom::Geometry::isRectangle: .......
geos::geom::GeometryFactory: ....................................
geos::geom::IntersectionMatrix: .............................
geos::geom::LineSegment: ......
geos::geom::LineString: .........................
geos::geom::LinearRing: ..............................
geos::geom::Location: ...
geos::geom::MultiLineString: .
geos::geom::MultiPoint: ............................
geos::geom::MultiPolygon: .
geos::geom::Point: ........................................
geos::geom::Polygon: .....................................
geos::geom::PrecisionModel: .........
geos::geom::Triangle: .....
geos::geom::prep::PreparedGeometryFactory: .............................
geos::geom::util::GeometryExtracter: ..
geos::index::quadtree::DoubleBits: .
geos::io::ByteOrderValues: ...
geos::io::WKBReader: .......
geos::io::WKBWriter: ...
geos::io::WKTReader: ......
geos::io::WKTWriter: .....
geos::linearref::LocationIndexedLine: ........................
geos::noding::BasicSegmentString: ....
geos::noding::NodedSegmentString: .....
geos::noding::SegmentNode: ....
geos::noding::SegmentPointComparator: .....
geos::noding::snapround::HotPixel: ..
geos::operation::IsSimpleOp: ...
geos::operation::buffer::BufferOp: ..........
geos::operation::buffer::BufferParameters: ..........
geos::operation::distance::DistanceOp: ...................
geos::operation::geounion::CascadedPolygonUnion: .
geos::operation::geounion::UnaryUnionOp: ......
geos::operation::linemerge::LineMerger: ......
geos::operation::linemerge::LineSequencer: ............
geos::operation::overlay::snap::GeometrySnapper: ..
geos::operation::overlay::snap::LineStringSnapper: .......
geos::operation::overlay::validate::FuzzyPointLocator: .......
geos::operation::overlay::validate::OffsetPointGenerator: .....
geos::operation::overlay::validate::OverlayResultValidator: ......
geos::operation::sharedpaths::SharedPathsOp: .....................
geos::operation::valid::IsValidOp: .
geos::operation::valid::ValidClosedRing: .....
geos::operation::valid::ValidSelfTouchingRingFormingHole: .......
geos::precision::SimpleGeometryPrecisionReducer: .......
geos::simplify::DouglasPeuckerSimplifier: ..........
geos::simplify::TopologyPreservingSimplifier: ...........
geos::util::UniqueCoordinateArrayFilter: .

---> group: capi::GEOSisValidDetail, test: test<3>
     problem: assertion failed
     failed assertion: "Values are not equal: expected 'POINT (NAN -5)' actual '
POINT (-1.#IND -5)'"

tests summary: failures:1 ok:744
FAIL: geos_unit.exe
==================
1 of 1 test failed
==================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory `/c/ming64/projects/geos/branches/3.3/tests/unit'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/c/ming64/projects/geos/branches/3.3/tests/unit'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/c/ming64/projects/geos/branches/3.3/tests'
make: *** [check-recursive] Error 1

comment:6 by strk, 12 years ago

Milestone: 3.3.33.3.4

comment:7 by strk, 12 years ago

Milestone: 3.3.4GEOS Future

Doesn't look like any developer is going to fix windows runs at any predictable time. So postponing milestone to generic "future" until someone comes up with a fix.

comment:8 by robe, 6 years ago

Milestone: GEOS FutureGEOS Fund Me

Milestone renamed

comment:9 by robe, 5 years ago

Milestone: GEOS Fund Me3.8.0
Resolution: fixed
Status: newclosed

I suspect this issue might be fixed in 3.8. I get a clean autotools build and make check now with xmltester under autotools.

It's now cmake where I'm having issue. I think Sandro Furieri (esseffe) was using autotools for building, so I suspect the issue is probably fixed for him.

Sandro, can you try retesting and reopen if its still an issue in 3.8. Feel free to reopen if it is.

We won't be back porting any changes though so will only work for 3.8+

Note: See TracTickets for help on using tickets.