Project-OSRM / osrm-backend

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

segfault in KML output #3

Closed DennisOSRM closed 12 years ago

DennisOSRM commented 13 years ago

The server segfaults on this:

0 KMLDescriptor<SearchEngine?<ContractionCleanup::Edge::EdgeData?, StaticGraph?<ContractionCleanup::Edge::EdgeData?>, NodeInformationHelpDesk?> >::Run (this=0x2aaab82002b0, reply=..., rawRoute=...,

phantomNodes=..., sEngine=..., distance=1) at Plugins/KMLDescriptor.h:81

1 0x000000000045f311 in RoutePlugin::HandleRequest? (this=0x6878b0, routeParameters=..., reply=...) at Plugins/RoutePlugin.h:148

2 0x000000000045cee1 in http::RequestHandler::handle_request (this=, req=..., rep=...) at Server/RequestHandler.h:89

3 0x000000000045e0d7 in http::Connection::handleRead (this=0x70f40f0, e=, bytes_transferred=) at Server/Connection.h:72

4 0x00000000004504ca in callboost::shared_ptr<http::Connection, boost::system::error_code const, unsigned long> (function=, context=)

at /usr/include/boost141/boost/bind/mem_fn_template.hpp:265

5 operator()boost::shared_ptr (function=, context=) at /usr/include/boost141/boost/bind/mem_fn_template.hpp:279

6 operator()<boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list2<boost::system::error_code&, unsigned long&> > (function=,

context=) at /usr/include/boost141/boost/bind/bind.hpp:385

7 operator()<boost::system::error_code, unsigned long> (function=, context=) at /usr/include/boost141/boost/bind/bind_template.hpp:61

8 operator() (function=, context=) at /usr/include/boost141/boost/asio/detail/bind_handler.hpp:96

9 asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long> > (function=, context=)

at /usr/include/boost141/boost/asio/handler_invoke_hook.hpp:62

10 invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> > > (function=, context=)

at /usr/include/boost141/boost/asio/detail/handler_invoke_helpers.hpp:39

11 asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long> (

function=, context=) at /usr/include/boost141/boost/asio/detail/bind_handler.hpp:130

12 invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long>, boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long> > (

function=, context=) at /usr/include/boost141/boost/asio/detail/handler_invoke_helpers.hpp:39

13 dispatch<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long> > (function=, context=)

at /usr/include/boost141/boost/asio/detail/strand_service.hpp:421

14 dispatch<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> >, boost::system::error_code, unsigned long> > (function=, context=)

at /usr/include/boost141/boost/asio/strand.hpp:118

15 operator()<boost::system::error_code, unsigned long> (function=, context=) at /usr/include/boost141/boost/asio/detail/wrapped_handler.hpp:71

16 operator() (function=, context=) at /usr/include/boost141/boost/asio/detail/bind_handler.hpp:96

17 operator() (function=, context=) at /usr/include/boost141/boost/asio/detail/wrapped_handler.hpp:143

18 asio_handler_invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::wrapped_handler<boost::asio::io_service::strand, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> > >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> > > > (function=, context=) at /usr/include/boost141/boost/asio/handler_invoke_hook.hpp:62

19 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::wrapped_handler<boost::asio::io_service::strand, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> > >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> > >, boost::_bi::bind_t<void, boost::_mfi::mf2<void, http::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3boost::_bi::value<boost::sharedptr, boost::arg<1> ()(), boost::arg<2> (_)()> > > (function=, context=)

at /usr/include/boost141/boost/asio/detail/handler_invoke_helpers.hpp:39 I.e this line: lastNodeID = (lastNodeID == rawRoute.segmentEndCoordinates[segmentIdx].startPhantom.startNode This is the bt full output for the first two entries:

0 KMLDescriptor<SearchEngine?<ContractionCleanup::Edge::EdgeData?, StaticGraph?<ContractionCleanup::Edge::EdgeData?>, NodeInformationHelpDesk?> >::Run (this=0x2aaab82002b0, reply=..., rawRoute=...,

phantomNodes=..., sEngine=..., distance=1) at Plugins/KMLDescriptor.h:81 tmpDistance = 2.3177964249919518e-310 path = @0x2aaab8200270 segmentIdx = lastNodeID = 37942867 s = travelTime =

1 0x000000000045f311 in RoutePlugin::HandleRequest? (this=0x6878b0, routeParameters=..., reply=...) at Plugins/RoutePlugin.h:148

phantomNodes = {startPhantom = {startNode = 37942867, targetNode = 46942484, ratio = 0.51219512194653316, location = {lat = 5259999, lon = 173325}}, targetPhantom = {startNode = 37942867, targetNode = 37942007, ratio = 0.9694173583904041, location = {lat = 5259972, lon = 173479}}} JSONParameter = {static npos = 18446744073709551615, _M_dataplus = {std::allocator = {<gnu_cxx::new_allocator> = {}, }, _M_p = 0x67f398 ""}} descriptorConfig = {instructions = false, geometry = false, encodeGeometry = false, z = 18, pc = {}} path = {<std::_Vector_base<_PathData, std::allocator<_PathData> >> = {_M_impl = {std::allocator<_PathData> = {<gnu_cxx::new_allocator<_PathData>> = {}, }, _M_start = 0x2aaab82003b0, _M_finish = 0x2aaab82003b4, _M_end_of_storage = 0x2aaab82003b4}}, } rawRoute = {routeSegments = {<std::_Vector_base<std::vector<_PathData, std::allocator<_PathData> >, std::allocator<std::vector<_PathData, std::allocator<_PathData> > > >> = { _M_impl = {<std::allocator<std::vector<_PathData, std::allocator<_PathData> > >> = {<gnu_cxx::new_allocator<std::vector<_PathData, std::allocator<_PathData> > >> = {}, }, _M_start = 0x2aaab8200270, _M_finish = 0x2aaab8200288, _M_end_of_storage = 0x2aaab8200288}}, },

segmentEndCoordinates = {<std::_Vector_base<PhantomNodes?, std::allocator<PhantomNodes?> >> = { _M_impl = {std::allocator<PhantomNodes?> = {<gnu_cxx::new_allocator<PhantomNodes?>> = {}, }, _M_start = 0x0, _M_finish = 0x0,

_M_end_of_storage = 0x0}}, }, rawViaNodeCoordinates = {<std::_Vector_base<_Coordinate, std::allocator<_Coordinate> >> = { _M_impl = {std::allocator<_Coordinate> = {<gnu_cxx::new_allocator<_Coordinate>> = {}, }, _M_start = 0x0, _M_finish = 0x0,

_M_end_of_storage = 0x0}}, }} distance = 1 desc = 0x2aaab82002b0 descriptorType = 0 lat1 = lon1 = tmp = {static npos = 18446744073709551615, _M_dataplus = {std::allocator = {<gnu_cxx::new_allocator> = {}, }, _M_p = 0x0}} lat2 = 0 lon2 = 1252060736 startCoord = {lat = 5260000, lon = 173333} targetCoord = {lat = 5259971, lon = 173479} zoom =

Sorry but I don't have enough time this late in the day to track down the actual request that caused this. (gdb) p rawRoute.segmentEndCoordinates $3 = {<std::_Vector_base<PhantomNodes?, std::allocator<PhantomNodes?> >> = {_M_impl = {std::allocator<PhantomNodes?> = {<gnu_cxx::new_allocator<PhantomNodes?>> = {}, },

_M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, } (gdb) p rawRoute.segmentEndCoordinates[segmentIdx].startPhantom.startNode One of the arguments you tried to pass to operator[] could not be converted to what the function wants.

DennisOSRM commented 13 years ago

KML will be deprecated sooner than later.

emiltin commented 12 years ago

moving to geo-json?

DennisOSRM commented 12 years ago

Not sure yet. The current JSON format is much more space saving and as easy to parse as the KML. Will have a look at geo-json though.

Am 25.11.2011 um 22:11 schrieb Emil Tin:

moving to geo-json?


Reply to this email directly or view it on GitHub: https://github.com/DennisOSRM/Project-OSRM/issues/3#issuecomment-2878144

DennisOSRM commented 12 years ago

KML has been removed from the current version.