-
Notifications
You must be signed in to change notification settings - Fork 6
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
Subtraction underflow crash calculating backwards lane count #102
Comments
Your fix looks good, please do send a PR! But also, could you print the osm
id of the offending road? We should fix the data there too, something seems
very wrong
…On Sat, Oct 15, 2022, 6:01 PM David Futcher ***@***.***> wrote:
Hi, I ran into a crash when trying to load Edinburgh, Scotland into A/B
Street:
thread 'main' panicked at 'attempt to subtract with overflow',
/home/david/.cargo/git/checkouts/osm2streets-fbbbdf753e406749/a55aef7/osm2streets/src/lanes/classic.rs:110
:20
Did some debugging and saw here
<https://github.com/a-b-street/osm2streets/blob/main/osm2streets/src/lanes/classic.rs#L110>,
n = 2 and num_driving_fwd=3, which doesn't make much sense, but was
causing a crash.
I added a workaround to check for situations where that subtraction would
underflow and default to 0 backward lanes, diff here:
main...dmfutcher:osm2streets:fix-lanes-calculation-crash
<main...dmfutcher:osm2streets:fix-lanes-calculation-crash>
but wasn't sure if that's the "correct" way to fix it. I'd be happy to hack
on this and submit a PR if you could give me some guidance on the correct
way to handle this situation (I found this software looking for something
to hack on for Hacktoberfest).
You can repro using this GeoJSON:
https://gist.github.com/dmfutcher/2b906f1b2b953a62ea1da8b361ab2fed
—
Reply to this email directly, view it on GitHub
<#102>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMWLF5E6RAEKCOR4HIHF73WDLPQHANCNFSM6AAAAAARF7NVFA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
PR submitted. I found and fixed the issue in the OSM data (way 413519168). |
dabreegster
added a commit
to a-b-street/abstreet
that referenced
this issue
Oct 15, 2022
Edinburgh looks alright after this fix! It's a huge area and slow to import / use, of course. The missing ocean is a-b-street/abstreet#32. If you hit more problems or get interested in working on anything, let me know -- thanks for trying stuff out and sending a fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I ran into a crash when trying to load Edinburgh, Scotland into A/B Street:
thread 'main' panicked at 'attempt to subtract with overflow', /home/david/.cargo/git/checkouts/osm2streets-fbbbdf753e406749/a55aef7/osm2streets/src/lanes/classic.rs:110:20
Did some debugging and saw here,
n = 2
andnum_driving_fwd=3
, which doesn't make much sense, but was causing a crash.I added a workaround to check for situations where that subtraction would underflow and default to 0 backward lanes, diff here: main...dmfutcher:osm2streets:fix-lanes-calculation-crash. This works and I successfully loaded Edinburgh, but I'm not sure if that's the "correct" way to fix it. I'd be happy to hack on this and submit a PR if you could give me some guidance on the correct way to handle this situation (I found this software looking for something to hack on for Hacktoberfest).
You can repro using this GeoJSON: https://gist.github.com/dmfutcher/2b906f1b2b953a62ea1da8b361ab2fed
The text was updated successfully, but these errors were encountered: