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

Luabind can't find trimLaneString, throws exception in osrm-extract #2594

Closed nigun closed 8 years ago

nigun commented 8 years ago

ubuntu 14.04 LTS map->http://data.gis-lab.info/osm_dump/dump/latest/RU-MOS.osm.pbf running: ln -s ../profiles/car.lua profile.lua running: ./osrm-extract -p profile.lua ./RU-MOS.osm.pbf i have error: [info] Using script profile.lua [info] Input file: RU-MOS.osm.pbf [info] Profile: profile.lua [info] Threads: 4 [STXXL-MSG] STXXL v1.3.1 (release) [STXXL-ERRMSG] Warning: no config file found. [STXXL-ERRMSG] Using default disk configuration. [STXXL-MSG] 1 disks are allocated, total space: 1000 MiB [info] Parsing in progress.. [info] input file generated by 0.44.1 [info] timestamp: n/a [info] Found 3 exceptions to turn restrictions: [info] motorcar [info] motor_vehicle [info] vehicle terminate called after throwing an instance of 'osrm::util::exception' what(): ERROR occurred in profile script: No matching overload found, candidates: std::string trimLaneString(std::string,int,int) Aborted (core dumped)

daniel-j-h commented 8 years ago

Can you be more specific about

MoKob commented 8 years ago

This looks related to: https://github.com/Project-OSRM/osrm-backend/issues/2590.

The function is defined here: https://github.com/Project-OSRM/osrm-backend/blob/master/include/extractor/extraction_helper_functions.hpp#L105-L108

And exported here: https://github.com/Project-OSRM/osrm-backend/blob/master/src/extractor/scripting_environment.cpp#L80

It seems that the match between std::int32_t and int might fail in your case. If you are on an older LUA version, try following the information in https://github.com/Project-OSRM/osrm-backend/issues/2590#issuecomment-228712892.

nigun commented 8 years ago

osrm-backend - curent version (clone yesterday) stdlib version -how to look? lua and luabind version 5.1.5 (run aptget install lua5.1 liblua5.1-0-dev libluabind-dev ) cmake output: -- Building on a 64 bit system -- Configuring OSRM in debug mode -- Setting linker optimizations -- Boost version: 1.54.0 -- Found the following Boost libraries: -- date_time -- filesystem -- iostreams -- program_options -- regex -- system -- thread -- Found Intel TBB -- TBB interface version: 7000 -- Looking for Luabind... -- Found Luabind: /usr/lib/libluabind.so -- Looking for LuaJIT 5.2 -- Could NOT find LUAJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR) -- Performing Test LUABIND_WORKS -- Performing Test LUABIND_WORKS - Success -- Luabind/Lua5.2 combination working with /usr/lib/x86_64-linux-gnu/liblua5.2.so -- Looking for STXXL... -- Found STXXL: /usr/lib/libstxxl.so -- OpenMP support found. Linking just in case for stxxl -- Enabling assertions -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Boost version: 1.54.0 -- Found the following Boost libraries: -- unit_test_framework -- Configuring done -- Generating done -- Build files have been written to: /osrm-backend/build

nigun commented 8 years ago

i`m edit function getTurnLanes(way) in car.lua: ... --add check if (fw_psv==nil) then print ('f') end if (bw_psv==nil) then print ('b') end .. start exctract i have outprint 'b' once add code in car.lua: if (turn_lanes ~=nil and fw_psv~=nil and bw_psc~=nik) then ( turn_lanes =trimLaneString(turn_lanes,bw_psv,fw_psv) ) end ... start excreact --> [info] Processed 895313 edges [info] Expansion : 55222.3 nodes/sec and 45697.4 edges/sec [info] To prepare the data for routing, run: ./osrm-contract ./RU-MOW.osrm

MoKob commented 8 years ago

It seems that, for some reason, your system generates a nil value for empty strings. So the issue seems luabind dependent. You can try using https://github.com/Project-OSRM/osrm-backend/pull/2598. This should fix your issues.

MoKob commented 8 years ago

Fixed by https://github.com/Project-OSRM/osrm-backend/pull/2598. Waiting for merge.