-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Assert during map-matching path unpacking #3429
Comments
On the assumption that @TheMarex was onto something, I dug into |
I've tracked down the problem to the following issue: due to the values put into the engine, we end up with negative initial segments that before could only happen if you looked at a route from The problem is related to loops on initial segments. I'll see if I can correctly filter these cases. Also: We are now routing on negative weights in a CH. The code was not designed to do so. |
Capturing from chat after a discussion with @TheMarex. The problem we experience is related to negative turn penalties and the offset computation in the geospatial query. The offset computation currently does not consider the turn-penalties correctly. If the turn penalty is too negative, we can perform a first relaxation that still offers negative weights (which should not be the case). The issue is essentially already fixed with the implementation of #77 #2399. Right now there is no easy fix around this problem, though, since we cannot separate turn penalties from our offsets right now. We are treating this as a known issue for v5.5, since negative turn penalties are unintended usage so far. With #77 implemented (hopefully v5.6), we should be able to correctly handle this problem without introducing brittle and hacky code for a quick fix. |
I just looked into the code for this and the main problem is again indexing: For #77 we index turn penalties by edge-based-edge id. However the problem in this specific case is that the offset of the first phantom node will be wrong. To fix this we would need indexing based on edge-based-node id: That is not that trivial since the turn penalty, of course, depends on which edge you turn on and is not static by edge-based-node id. Thinking about this more, we might want to rewrite the way we handle start nodes in our search code. At the moment we have the following behavior that utilizes negative initial weights:
We could switch to only ever using positive weights:
In the second approach we would need to have a modified relax step for the start node, that actually does not use the edge-based-edge weight. In both cases the current approach for the target node just work, since we only pay turn penalties when turning from a node, not when arriving. |
👋 Any updates here? Will landing issue 77 as it's written now help these situations? ...or is there still work to do? |
@miccolis this bug is still outstanding if negative turn penalties are applied. |
For those of you that have been looking into this, does this stack trace look like the same underlying issue? (Segfault in a release build)
|
@springmeyer possibly, but hard to say - if the assertion isn't thrown, we end up in an undefined state, possibly leading to a SEGFAULT. Do you have any more details on where this trace came from? (i.e. the request that triggered it, profile used, OSRM version, etc?) |
It seems that some combinations of traffic/turn cost data can lead to the following assertion being thrown:
The assertion is triggered with this request:
http://localhost:5000/match/v1/driving/-122.505588,37.872619;-122.505702,37.872678?annotations=true&geometries=geojson
which represents this:
With no traffic data/turn penalty data applied, it works as expected. The problem thus seems to be either an edge-case caused by the data, or something we're doing wrong when applying traffic data.
After chatting with @TheMarex, a suspect is https://github.com/Project-OSRM/osrm-backend/blob/master/include/contractor/graph_contractor.hpp#L826
The text was updated successfully, but these errors were encountered: