Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.42k stars 3.4k forks source link

OSRM crashes on mapmatching request #5195

Open ghoshkaj opened 6 years ago

ghoshkaj commented 6 years ago

The following request causes OSRM to crash:

curl "0.0.0.0:5000/match/v1/car/-6.77257776260376,62.01202379225278;-6.772427558898926,62.01181232591307;-6.772363185882568,62.01167134753738;-6.772899627685547,62.01162099795931;-6.773650646209717,62.01141959881448;-6.774380207061768,62.01136924882014?radiuses=40;40;40;40;40;40"

This is the failing error, in debug mode:

[assert][0x7000065d1000] /Users/kajari/Mapbox/osrm-backend/src/engine/routing_algorithms/routing_base.cpp:103
in: EdgeDistance osrm::engine::routing_algorithms::adjustPathDistanceToPhantomNodes(const std::vector<NodeID> &, const osrm::engine::PhantomNode &, const osrm::engine::PhantomNode &, const EdgeDistance): distance >= 0 || distance > -1.0f
Distance correction generated negative number

If I change radiuses=40;40;40;40;40;40 to radiuses=9;9;9;9;9;9 the request gets through a response is returned. However, changing it to radiuses >=10 causes a crashing failure.

This request passes on Master before https://github.com/Project-OSRM/osrm-backend/pull/5060 was merged, so we should add a regression test in OSRM to test this scenario so that in the future we can catch this scenario!

ghoshkaj commented 6 years ago

I think this is a duplicate of https://github.com/Project-OSRM/osrm-backend/issues/5168