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

Extraction aborts on unsanitized data #12

Open
rebos opened this issue Apr 14, 2021 · 0 comments
Open

Extraction aborts on unsanitized data #12

rebos opened this issue Apr 14, 2021 · 0 comments

Comments

@rebos
Copy link

rebos commented Apr 14, 2021

Running osrm-extract with the truck-soft profile and the associated scripts from the lib directory (v5.21), I stumbled over errors concerning unsanitized input data. Unfortunately the extract process aborted.

The first error was this one:
what(): lua: error: /opt/truck_soft.lua:353: attempt to compare string with number

I was able to cirumvent this by adding a call to the function tonumber().

The next one was this one:
what(): lua: error: /opt/lib/way_handlers.lua:483: attempt to compare string with number

Trying to apply the same fix by calling tonumber() led to this error message:
what(): lua: error: /opt/lib/way_handlers.lua:483: attempt to compare nil with number

Data seams to be involved, that cannot be converted to a number. So to make the conversion more robust, I decided to add a check: First try to convert the data to a number and only if this works (result is not nil) then use that converted data. By the way: I am using data provided by Geofabrik consisting of OpenStreetMap data for the sub region Europe and osrm-backend v5.24.0 from Docker Hub.

I will create a PR so someone can examine my workaround. Calling tonumber() twice within one statement may not be the smartest solution. But it works for me and I cannot observe any regression concerning the duration of the extract process.

Thanks and greetings,
rebos

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