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

Negative Durations on Demo Server / Invalid self-loop in CH alternative impl. #3647

Open
MoKob opened this issue Feb 3, 2017 · 6 comments
Open

Comments

@MoKob
Copy link

MoKob commented Feb 3, 2017

screen shot 2017-02-03 at 10 27 55

demo-server-frontend demo-server-backend

Currently produces an assertion on the demo server:

[assert]/include/engine/guidance/assemble_steps.hpp:206
in: std::vector<osrm::engine::guidance::RouteStep> osrm::engine::guidance::assembleSteps(const osrm::engine::datafacade::BaseDataFacade&, const std::vector<osrm::engine::PathData>&, const osrm::engine::guidance::LegGeometry&, const osrm::engine::PhantomNode&, const osrm::engine::PhantomNode&, bool, bool): duration >= 0
terminate called without an active exception

The problem is within this alternative route that we find:
screen shot 2017-02-03 at 10 32 11

Which goes against a oneway (and in total finds a negative duration).

Due to the random nature of alternatives, I've not been able to reproduce this yet. For single paths it seems fine and does not discover the path against the oneway.

@daniel-j-h
Copy link
Member

I think I figured it out why this happens.

When the phantom nodes start and end on the same segment we have to force loops in the search. We do this for the shortest path search, but we fail to do this for the alternative search.

  • Here we never force loops in the alternatives search
  • Here are the checks to tell if we need to force loops based on the phantom nodes

We need to reproduce the issue, though.

@daniel-j-h
Copy link
Member

I wasn't able to reproduce this behavior so far. Which makes it a bit hard to fix.

Here's the approach I'm taking for repeatedly generate contraction orders and then see if routed asserts.

#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset

wget http://download.geofabrik.de/asia/vietnam-latest.osm.pbf
osmium extract --bbox 105.4632568359375,20.684183779352395,106.27349853515625,21.496519114833735 vietnam-latest.osm.pbf -o hanoi.osm.pbf
./osrm-extract -p ../profiles/car.lua hanoi.osm.pbf

while true; do
    ./osrm-contract hanoi.osrm > /dev/null

    ./osrm-routed hanoi.osrm &
    sleep 0.1
    curl 'http://localhost:5000/route/v1/driving/105.86564000000001,21.008730000000003;105.86486518965302,21.008315070735108?overview=false&alternatives=true&steps=true' | jq '.routes'
    pkill osrm-routed

done

@TheMarex
Copy link
Member

@daniel-j-h maybe try putting osrm-extract in the loop as well: There might be some non-determinism introduced by the initial parsing/sorting.

@daniel-j-h
Copy link
Member

Still can't trigger and reproduce after running it for hours.

(note: osrm-routed needs to be compiled with assertions on)

@miccolis
Copy link
Contributor

miccolis commented Oct 2, 2017

Stale ticket. If anyone has seen this recently please re-open.

@miccolis miccolis closed this as completed Oct 2, 2017
@daniel-j-h
Copy link
Member

Negative durations with loops in the CH alternatives impl. is still an issue.

@daniel-j-h daniel-j-h reopened this Oct 2, 2017
@daniel-j-h daniel-j-h changed the title Negative Durations on Demo Server / Invalid self-loop as alternative Negative Durations on Demo Server / Invalid self-loop in CH alternative impl. Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants