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

Crash: thread 'main' panicked at 'Queue has spillover on Traversable::Lane ... sim/src/mechanics/queue.rs:91:17 #30

Closed
andrewguertin opened this issue Dec 14, 2019 · 3 comments

Comments

@andrewguertin
Copy link

I'm getting a frequent crash at sim/src/mechanics/queue.rs#L91. It occurs after a few (game-time) hours of simulating huge_seattle with weekday_typical_traffic_from_psrc, if another crash doesn't happen first.

On Traversable::Lane(85385) at 07:56:35.6...
- CarID(38433 -- car) @ 84.9242m (length 4.8234m)
  Queued currently
- CarID(57086 -- car) @ 79.1008m (length 5.3613m)
  Queued currently
- CarID(4276 -- car) @ 72.7395m (length 6.1767m)
  Queued currently
- CarID(42418 -- car) @ 65.5628m (length 6.1847m)
  Queued currently
- CarID(140777 -- car) @ 44.0905m (length 4.8075m)
  Parking during 07:56:34.6 .. 07:56:49.6
- CarID(144640 -- car) @ 38.283m (length 5.1546m)
  Queued currently
- CarID(42154 -- car) @ 32.1284m (length 4.6616m)
  Queued currently
- CarID(134617 -- car) @ 15.6336m (length 5.2654m)
  Queued currently
- CarID(38281 -- car) @ 9.3682m (length 6.246m)
  Queued currently
- CarID(36155 -- car) @ 2.1222m (length 5.1077m)
  Queued currently

thread 'main' panicked at 'Queue has spillover on Traversable::Lane(85385) at 07:56:35.6 -- can't draw CarID(44507 -- car), bound is -3.9855m. Laggy head is Some(CarID(78903, Car))', sim/src/mechanics/queue.rs:91:17

Attached a few logs of the last minute of console output with backtrace.

queue.rs-91-1.txt
queue.rs-91-2.txt
queue.rs-91-3.txt

@dabreegster
Copy link
Collaborator

Thanks for the logs! The full weekday scenario on huge_seattle has loads of bugs -- this one is a known issue. (Getting a full day to complete without hitting permanent gridlock is only possible right now on the montlake map, which has lots of manual fixes to short roads / coupled intersections.)

I'm pretty sure this particular problem happens when there's a nice cycle of laggy heads (see https://github.com/dabreegster/abstreet/blob/master/docs/articles/trafficsim/article.md#exact-positions). I need to make an easy test case to repro this (using map_editor to create a synthetic map) and then think through what should happen here.

@dabreegster
Copy link
Collaborator

Screenshot from 2020-04-12 15-26-50

I happened to get an easy repro of this problem. When a car is half in a turn, half on the end of the last lane, they're a "laggy head. That influences the front position of the first car on a lane; the laggy head prevents the first in the queue from being at the very end of the lane. get_car_positions recurses to figure out exactly where the back of the laggy head is. I have to figure out how to break the recursion and decide where the back of a car is for this case

@dabreegster
Copy link
Collaborator

I think this particular issue is gone. https://github.com/dabreegster/abstreet/projects/2 the best way to track current work on getting simulations on large maps to work properly.

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

2 participants