Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profiles/lib/guidance.lua throwing error trying to call trimLaneString #2850

Closed
danpat opened this issue Sep 4, 2016 · 0 comments
Closed

Comments

@danpat
Copy link
Member

danpat commented Sep 4, 2016

While trying to replicate #2832, I'm hitting this error using the current master (bb244e2):

$ ./osrm-extract -p ../profiles/car.lua ../../unprocessed-osm.pbf
[info] input file generated by Osmium (http://wiki.openstreetmap.org/wiki/Osmium)
[info] timestamp: 2015-11-11T22:22:02Z
[info] Found 3 exceptions to turn restrictions:
[info]   motorcar
[info]   motor_vehicle
[info]   vehicle
[New Thread 0x7fffbf7fe700 (LWP 73528)]
[New Thread 0x7fffbeffd700 (LWP 73529)]
[New Thread 0x7fffbe7fc700 (LWP 73530)]
[New Thread 0x7fffc47f8700 (LWP 73531)]
[New Thread 0x7fffbdffb700 (LWP 73532)]
[New Thread 0x7fffbdbfa700 (LWP 73533)]
[New Thread 0x7fffbd3f8700 (LWP 73534)]
[New Thread 0x7fffbd7f9700 (LWP 73535)]
[New Thread 0x7fffbcbf5700 (LWP 73536)]
[New Thread 0x7fffbc7f4700 (LWP 73537)]
[New Thread 0x7fff97bfe700 (LWP 73539)]
[New Thread 0x7fff973fc700 (LWP 73541)]
[New Thread 0x7fff977fd700 (LWP 73540)]
[New Thread 0x7fff97fff700 (LWP 73538)]
[New Thread 0x7fff96bfa700 (LWP 73543)]
[New Thread 0x7fff967f9700 (LWP 73544)]
[New Thread 0x7fff96ffb700 (LWP 73542)]
[New Thread 0x7fff963f8700 (LWP 73545)]
[New Thread 0x7fff95ff7700 (LWP 73546)]
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)

It looks like the problem might lie here:

https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/lib/guidance.lua#L99

Something about the (17GB) EU extract linked in #2832 that I'm using is causing one of the parameters to trimLaneString to be nil (I think), and luabind is not finding a matching function call (it's expecting to find a string,int,int function, and because Lua has no types, nil is neither string or int).

Without digging too deep here, I tried applying this change:

diff --git a/profiles/lib/guidance.lua b/profiles/lib/guidance.lua
index 3a4106e..d39d438 100644
--- a/profiles/lib/guidance.lua
+++ b/profiles/lib/guidance.lua
@@ -95,7 +95,7 @@ local function process_lanes(turn_lane,vehicle_lane,first_count,second_count)
     if turn_lane and turn_lane ~= "" then
         if vehicle_lane and vehicle_lane ~= "" then
             turn_lane = applyAccessTokens(turn_lane,vehicle_lane)
-        elseif fw_count ~= 0 or bw_count ~= 0 then
+        elseif first_count ~= 0 or second_count ~= 0 then
             turn_lane = trimLaneString(turn_lane, first_count, second_count)
         end
     end

but that wasn't sufficient, the same error is still being thrown.

/cc @MoKob @daniel-j-h

@danpat danpat changed the title Guidance Lua profile throwing error profiles/lib/guidance.lua throwing error trying to call trimLaneString Sep 4, 2016
@MoKob MoKob mentioned this issue Sep 5, 2016
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant