gis-ops / pyvalhalla

High-level Python bindings to the Valhalla routing framework.
GNU General Public License v2.0
67 stars 5 forks source link

Segment fault #24

Open vtao1989 opened 1 year ago

vtao1989 commented 1 year ago

Package and system information: pyvalhalla 3.0.3 with python 3.10.6 in the Debian Linux 11.

My task was to map match several trips to the roads. The issue was that, after trace_route returned a RuntimeError with "Exact route match algorithm failed to find path" when map matching a trip, map matching another trip caused the "Segment fault" error.

nilsnolde commented 1 year ago

I can't see how this causes a segfault within Valhalla (let alone the bindings, we don't do anything special here):

https://github.com/valhalla/valhalla/blob/5f59706b8a172f8e664835f79f1928c2de8fb837/src/thor/trace_route_action.cc#L84-L92

Can you provide a minimum example request (as few points as possible)?

vtao1989 commented 1 year ago

Sure.

You can find the code and data in this repo. The data contains GPS points of two trips.

I used the tiles built from PA, US. The repo does not allow me to upload large-size files. So you probably need to build tiles by yourself. Sorry for the inconvenience.

I tested this code in Windows and Linux, and the same issue occurred on both.

Thanks.

nikosece commented 1 year ago

I had the same issue. In my case it was solved after increasing the trace_options.search_radius to 50 meters

nilsnolde commented 1 year ago

Also windows? Did you try other OSs?

Oops, @vtao1989 was also on Linux.. Do you have an easier way to replicate by any chance?

thomthom commented 1 month ago

I'm experiencing that my python script terminates unexpectedly after calling actor.trace_route.

echo %ERRORLEVEL% returns -1073740791

I'm not able to find the source of the crash in the python code itself, it crashes when I try to step into return super().trace_route(req)

I'm on Windows, Python 3.11, pyvalhalla 3.2.0.