mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Differences in results on OSX and Linux for #107

Closed springmeyer closed 9 years ago

springmeyer commented 9 years ago

Travis tests on linux are currently failing after calling boost::geometry::correct on the multipolygon data used in the vector tile from simplified geojson test. For some reason this triggered differences in the test result across osx and linux.

This issue is to track getting to the bottom of this failure. @flippmoke and I will dump ideas as comments.

springmeyer commented 9 years ago

I think we should try to narrow the test failure down first by removing the JSON parsing. Today I ran mapnik-vt and mapnik through clang -fsanitize=address and hit https://github.com/mapnik/mapnik/issues/2846 which is being triggered only by build_geojson_ds which is only used in this single failing test. So, we should try to rule out that issue as a cause.

flippmoke commented 9 years ago

@springmeyer we can easily narrow that down by adding a to WKT to the failing unit test.

flippmoke commented 9 years ago

@springmeyer After lots and lots of digging I found the reason for this. It is directly related the use of std::sort rather then std::stable_sort in the clipper. This was fixed in https://github.com/mapnik/mapnik/commit/775fcb53784b0a1cf73b3d5fea2f1b650947e068 and the tests have been updated in https://github.com/mapbox/mapnik-vector-tile/commit/a818ae6181279fbe2f11641af6afa866ba5db429

springmeyer commented 9 years ago

It is directly related the use of std::sort rather then std::stable_sort in the clipper

Wow, interesting. Do you think this should be provided upstream to clipper?