Skip to content

osrm-routed segfaults/asserts #7203

@Charmik

Description

@Charmik

Issue

Hi! I do a lot of requests to osrm-routing (don't ask me why) and in some zones I see a lot of segfaults (or asserts if I use debug version). For example in this part: https://download.geofabrik.de/asia/gcc-states.html
It reproduces very stable expecially in debug mode - same asserts at the same places.

Steps to reproduce

(I always merge .pbf because it allows me not to change next scripts):

osmium merge gcc-states-latest.osm.pbf -o merged.osm.pbf
docker run --rm -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend:v6.0.0 osrm-extract -p /data/bicycle.lua /data/merged.osm.pbf || echo "osrm-extract failed"
docker run --rm -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend:v6.0.0 osrm-partition /data/merged.osrm || echo "osrm-partition failed"
docker run --rm -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend:v6.0.0 osrm-customize /data/merged.osrm || echo "osrm-customize failed"
docker run --rm -t -i -p 8003:5000 -v "${PWD}:/data" --name osrm-backend ghcr.io/project-osrm/osrm-backend:v6.0.0 osrm-routed --algorithm mld /data/merged.osrm

I think you can easily reproduce it in GCC if you just choose any 2 random points in GCC location and repeat it for a few minutes (that's mostly what I do, but again I can reproduce it stable and provide list of queries if needed).

Now there are 2 cases:

  1. Release: I take osrm-lib and use it from Java-app using JNI - it segfaults in release. If I use server with HTTP - no segfaults in osrm-routed
  2. Debug: even when I use osrm-routed as different service via HTTP - it fails with many asserts (I think I am just lucky that I don't segfault in this case, but it segfaults when I call it by native code.) and these asserts seems very dangerous.

Debug mode: failed assserts (even with seperate osrm-routed instance by HTTP):

[assert][140358960797376] /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms/routing_base_mld.hpp:337
in: void osrm::engine::routing_algorithms::mld::relaxOutgoingEdges(osrm::engine::DataFacade<Algorithm>&, Heap&, const typename Heap::HeapNode&, const Args& ...) [with bool DIRECTION = true; Algorithm = Algorithm; Heap = osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int> >; Args = {osrm::engine::PhantomEndpointCandidates}; osrm::engine::DataFacade<Algorithm> = osrm::engine::datafacade::ContiguousInternalMemoryDataFacade<Algorithm>; typename Heap::HeapNode = osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int> >::HeapNode]: to_weight >= heapNode.weight
terminate called without an active exception
Aborted
[assert][132867858347712] /home/charm/disk/osrm-backend-copy/include/util/query_heap.hpp:327
in: void osrm::util::QueryHeap<NodeID, Key, Weight, Data, IndexStorage>::DecreaseKey(const HeapNode&) [with NodeID = unsigned int; Key = unsigned int; Weight = osrm::Alias<int, tag::edge_weight>; Data = osrm::engine::MultiLayerDijkstraHeapData; IndexStorage = osrm::util::TwoLevelStorage<unsigned int, int>]: !WasRemoved(heapNode.node)
terminate called without an active exception
Aborted
[assert][136318296250048] /home/charm/disk/osrm-backend-copy/include/util/d_ary_heap.hpp:37
in: void osrm::util::DAryHeap<HeapData, Arity, Comparator>::decrease(HeapHandle, HeapData&&, ReorderHandler&&) [with ReorderHandler = osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int> >::DecreaseKey(const HeapNode&)::<lambda(const auto:113&, auto:114)>; HeapData = osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int> >::HeapData; int Arity = 4; Comparator = std::less<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int> >::HeapData>; HeapHandle = long unsigned int]: handle < heap.size()
terminate called without an active exception
Aborted
  1. If I just comment 3 asserts above I get this fail in gdb:
#4  0x00007ffff68288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff68297b6 in __libc_message_impl (fmt=fmt@entry=0x7ffff69ce8d7 "%s\n") at ../sysdeps/posix/libc_fatal.c:134
#6  0x00007ffff68a8ff5 in malloc_printerr (str=str@entry=0x7ffff69d1520 "munmap_chunk(): invalid pointer") at ./malloc/malloc.c:5772
#7  0x00007ffff68a947c in munmap_chunk (p=<optimized out>) at ./malloc/malloc.c:3040
#8  0x00007ffff68addfa in __GI___libc_free (mem=0x7fccc8030f70) at ./malloc/malloc.c:3388
#9  0x00007ffff7b84ea8 in std::__new_allocator<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData>::deallocate (this=<optimized out>, __p=<optimized out>, __n=<optimized out>)
    at /usr/include/c++/14/bits/new_allocator.h:172
#10 0x00007ffff7b84ec7 in std::allocator<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData>::deallocate (this=<optimized out>, __p=<optimized out>, __n=<optimized out>)
    at /usr/include/c++/14/bits/allocator.h:201
#11 std::allocator_traits<std::allocator<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> >::deallocate (__a=..., __p=<optimized out>, __n=<optimized out>)
    at /usr/include/c++/14/bits/alloc_traits.h:513
#12 std::vector<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData, std::allocator<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> >::_M_realloc_append<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData>(osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData&&)::_Guard::~_Guard() (this=<optimized out>, __in_chrg=<optimized out>)
    at /usr/include/c++/14/bits/vector.tcc:616
#13 0x00007ffff7b86087 in std::vector<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData, std::allocator<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> >::_M_realloc_append<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> (this=this@entry=0x7fccc80017e0) at /usr/include/c++/14/bits/vector.tcc:688
#14 0x00007ffff7b8611a in std::vector<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData, std::allocator<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> >::emplace_back<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> (this=this@entry=0x7fccc80017e0) at /usr/include/c++/14/bits/vector.tcc:123
#15 0x00007ffff7b8614a in osrm::util::DAryHeap<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData, 4, std::less<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData> >::emplace<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::Insert(unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData const&)::{lambda(auto:1 const&, auto:2)#1}>(osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::HeapData&&, osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::Insert(unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData const&)::{lambda(auto:1 const&, auto:2)#1}&&) (this=this@entry=0x7fccc80017d8, data=..., reorderHandler=...) at /home/charm/disk/osrm-backend-copy/include/util/d_ary_heap.hpp:30
#16 0x00007ffff7b879ec in osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >::Insert (this=this@entry=0x7fccc80017c0, node=node@entry=8107, weight=..., data=...)
    at /home/charm/disk/osrm-backend-copy/include/util/query_heap.hpp:183
#17 0x00007ffff7b87d43 in osrm::engine::routing_algorithms::mld::insertOrUpdate<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> > > (heap=..., node=node@entry=8107, weight=weight@entry=...,
    data=...) at /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms/routing_base_mld.hpp:282
#18 0x00007ffff7b87fa5 in osrm::engine::routing_algorithms::mld::relaxOutgoingEdges<true, osrm::engine::routing_algorithms::mld::Algorithm, osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >, osrm::engine::PhantomEndpointCandidates> (facade=..., forward_heap=..., heapNode=...) at /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms/routing_base_mld.hpp:347
#19 0x00007ffff7b881fb in osrm::engine::routing_algorithms::mld::routingStep<true, osrm::engine::routing_algorithms::mld::Algorithm, osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >, osrm::engine::PhantomEndpointCandidates> (facade=..., forward_heap=..., reverse_heap=..., middle_node=@0x7fcce6ffb22c: 4294967295, path_upper_bound=..., force_step_nodes=std::vector of length 0, capacity 0) at /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms/routing_base_mld.hpp:480
#20 0x00007ffff7b8ad1e in osrm::engine::routing_algorithms::mld::runSearch<osrm::engine::routing_algorithms::mld::Algorithm, osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage> >, osrm::engine::PhantomEndpointCandidates> (facade=..., forward_heap=..., reverse_heap=..., force_step_nodes=std::vector of length 0, capacity 0, weight_upper_bound=..., weight_upper_bound@entry=...) at /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms/routing_base_mld.hpp:524
#21 0x00007ffff7b8b05a in osrm::engine::routing_algorithms::mld::search<osrm::engine::routing_algorithms::mld::Algorithm, osrm::engine::PhantomEndpointCandidates> (engine_working_data=..., facade=..., forward_heap=..., reverse_heap=..., force_step_nodes=std::vector of length 0, capacity 0, weight_upper_bound=...)
    at /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms/routing_base_mld.hpp:556
#22 0x00007ffff7b8aa68 in osrm::engine::routing_algorithms::directShortestPathSearch<osrm::engine::routing_algorithms::mld::Algorithm> (engine_working_data=..., facade=..., endpoint_candidates=...) at /home/charm/disk/osrm-backend-copy/src/engine/routing_algorithms/direct_shortest_path.cpp:79
#23 0x00007ffff7ac8e08 in osrm::engine::RoutingAlgorithms<osrm::engine::routing_algorithms::mld::Algorithm>::DirectShortestPathSearch (this=this@entry=0x7fcce6ffb7c0, endpoint_candidates=...) at /home/charm/disk/osrm-backend-copy/include/engine/routing_algorithms.hpp:173
#24 0x00007ffff7b647da in osrm::engine::plugins::ViaRoutePlugin::HandleRequest (this=this@entry=0x555555f9d478, algorithms=..., route_parameters=..., result=std::variant [index 0] = {...}) at /home/charm/disk/osrm-backend-copy/src/engine/plugins/viaroute.cpp:117
#25 0x00007ffff7ac7d67 in osrm::engine::Engine<osrm::engine::routing_algorithms::mld::Algorithm>::Route (this=0x555555f9d460, params=..., result=std::variant [index 0] = {...}) at /home/charm/disk/osrm-backend-copy/include/engine/engine.hpp:91
#26 0x00007ffff7a8c555 in osrm::OSRM::Route (this=this@entry=0x555555f9fd40, params=..., result=std::variant [index 0] = {...}) at /home/charm/disk/osrm-backend-copy/src/osrm/osrm.cpp:65
#27 0x0000555555d10059 in osrm::server::service::RouteService::RunQuery (this=0x555555fa1a30, prefix_length=18, query=..., result=std::variant [index 0] = {...}) at /home/charm/disk/osrm-backend-copy/src/server/service/route_service.cpp:73
#28 0x0000555555d12504 in osrm::server::ServiceHandler::RunQuery (this=this@entry=0x555555f9fd00, parsed_url=..., result=std::variant [index 0] = {...}) at /home/charm/disk/osrm-backend-copy/src/server/service_handler.cpp:48
#29 0x0000555555cf39ea in osrm::server::RequestHandler::HandleRequest (this=<optimized out>, current_request=..., current_reply=...) at /home/charm/disk/osrm-backend-copy/src/server/request_handler.cpp:105
#30 0x0000555555cd474f in osrm::server::Connection::handle_read (this=0x7fcce0000c30, error=..., bytes_transferred=<optimized out>) at /home/charm/disk/osrm-backend-copy/src/server/connection.cpp:84
#31 0x0000555555ce783b in boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>::call<std::shared_ptr<osrm::server::Connection>, boost::system::error_code const, unsigned long> (this=this@entry=0x7fcce6ffc4c0, u=..., b1=..., b2=b2@entry=@0x7fcce6ffc2d8: 324) at /usr/include/boost/bind/mem_fn_template.hpp:271
#32 0x0000555555ce7867 in boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>::operator()<std::shared_ptr<osrm::server::Connection> > (this=this@entry=0x7fcce6ffc4c0, u=..., a1=..., a2=<optimized out>, a2@entry=324) at /usr/include/boost/bind/mem_fn_template.hpp:286
#33 0x0000555555ce78d5 in boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()>::operator()<boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::rrlist2<boost::system::error_code const&, unsigned long const&> > (this=this@entry=0x7fcce6ffc4d0, f=...,
    a=...) at /usr/include/boost/bind/bind.hpp:378
#34 0x0000555555ce7925 in boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >::operator()<boost::system::error_code const&, unsigned long const&> (this=0x7fcce6ffc4c0, a1=...,
    a2=<optimized out>) at /usr/include/boost/bind/bind.hpp:1298
#35 0x0000555555ce7957 in boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long>::operator() (this=<optimized out>)
    at /usr/include/boost/asio/detail/bind_handler.hpp:289
#36 0x0000555555ce79b4 in boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long> >
    (function=...) at /usr/include/boost/asio/handler_invoke_hook.hpp:88
#37 0x0000555555ce79de in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> > > (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:54
#38 0x0000555555ce8ffc in boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long> (function=..., this_handler=<optimized out>)
    at /usr/include/boost/asio/detail/bind_handler.hpp:344
#39 0x0000555555ce98c0 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, 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, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long> > (function=..., context=...)
    at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:54
#40 0x0000555555ce9929 in boost::asio::detail::executor_function::complete<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, osrm::server::Connection, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<std::shared_ptr<osrm::server::Connection> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long>, std::allocator<void> > (base=0x7fccc80217a0, call=true) at /usr/include/boost/asio/detail/executor_function.hpp:116
#41 0x0000555555b9bb63 in boost::asio::detail::executor_function::operator() (this=<optimized out>) at /usr/include/boost/asio/detail/executor_function.hpp:64
#42 0x0000555555bbe773 in boost::asio::asio_handler_invoke<boost::asio::detail::executor_function> (function=...) at /usr/include/boost/asio/handler_invoke_hook.hpp:88
#43 0x0000555555bbf136 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::executor_function, boost::asio::detail::executor_function> (function=..., context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:54
#44 0x0000555555bbf442 in boost::asio::detail::executor_op<boost::asio::detail::executor_function, std::allocator<void>, boost::asio::detail::scheduler_operation>::do_complete (owner=0x7fcce0002ea0, base=0x7fccc8062860) at /usr/include/boost/asio/detail/executor_op.hpp:71
#45 0x0000555555b9c96e in boost::asio::detail::scheduler_operation::complete (this=this@entry=0x7fccc8062860, owner=<optimized out>, ec=..., bytes_transferred=bytes_transferred@entry=0) at /usr/include/boost/asio/detail/scheduler_operation.hpp:40
#46 0x0000555555cd9219 in boost::asio::detail::strand_executor_service::run_ready_handlers (impl=std::shared_ptr<boost::asio::detail::strand_executor_service::strand_impl> (use count 5, weak count 0) = {...}) at /usr/include/boost/asio/detail/impl/strand_executor_service.ipp:150
#47 0x0000555555cecbe1 in boost::asio::detail::strand_executor_service::invoker<boost::asio::io_context::basic_executor_type<std::allocator<void>, 4ul> const, void>::operator() (this=<optimized out>) at /usr/include/boost/asio/detail/impl/strand_executor_service.hpp:136
#48 0x0000555555cecc8b in boost::asio::asio_handler_invoke<boost::asio::detail::strand_executor_service::invoker<boost::asio::io_context::basic_executor_type<std::allocator<void>, 4ul> const, void> > (function=...) at /usr/include/boost/asio/handler_invoke_hook.hpp:88
#49 0x0000555555ceccb5 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::strand_executor_service::invoker<boost::asio::io_context::basic_executor_type<std::allocator<void>, 4ul> const, void>, boost::asio::detail::strand_executor_service::invoker<boost::asio::io_context::basic_executor_type<std::allocator<void>, 4ul> const, void> > (function=..., context=...)
    at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:54

Release mode:

#  SIGSEGV (0xb) at pc=0x000000010cc234c4, pid=5830, tid=63491

C  [libosrmjni.dylib+0x8f4c4]  void osrm::engine::routing_algorithms::mld::insertOrUpdate<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage>>>(osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage>>&, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::MultiLayerDijkstraHeapData, osrm::util::TwoLevelStorage<unsigned int, int, osrm::util::UnorderedMapStorage, osrm::util::ArrayStorage>>::DataType const&)+0x120
#  SIGSEGV (0xb) at pc=0x0000000101cadf18, pid=70329, tid=45827
# C  [libosrmjni.dylib+0x65f18]  void osrm::util::DAryHeap<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::HeapData, osrm::util::UnorderedMapStorage<unsigned int, int>>::HeapData, 4, std::__1::less<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::HeapData, osrm::util::UnorderedMapStorage<unsigned int, int>>::HeapData>>::heapifyUp<osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::HeapData, osrm::util::UnorderedMapStorage<unsigned int, int>>::DecreaseKey(osrm::util::QueryHeap<unsigned int, unsigned int, osrm::Alias<int, tag::edge_weight>, osrm::engine::HeapData, osrm::util::UnorderedMapStorage<unsigned int, int>>::HeapNode const&)::'lambda'(auto const&, auto)>(unsigned long, auto&&)+0xa0

I have many more fails - and I have many hs_err files from JVM witth more details - if needed I can send them privately.

As you can see DecreaseKey method we see in asserts part - and in release mode - with SIGSEGV - so I think it's the same problem - and we need to fix something, but the assert.

This reproduces very well on MacOS & Ubuntu 24 with OSRM 6.0.0 (I haven't tried old version of OSRM).

I made simple fixes which help not to crash anymore - but I am sure there should be a better fix for this.
#7204

Specifications

Please provide details of your development environment.

  • standards libs from setup instruction
  • Mac/Ubuntu
  • Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz / M3 Mac

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions