-
Notifications
You must be signed in to change notification settings - Fork 5
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
Panic at 'attempt to subtract with overflow'; due to cpr_nl returning invalid values #3
Comments
wiseman
added a commit
to wiseman/adsb
that referenced
this issue
Jan 22, 2021
cpr_nl was returning 0 in some cases, which could lead to panics. This change switches cpr_nl from a trigonometry-based implementation to (essentially) a table lookup. I added a couple unit tests, and a criterion benchmark for cpr_nl to validate the table-based speedup. On my machine this version is, in the worst case situation, 40% faster. In the best case it's 89% faster. ``` cpr_nl_high_lat time: [10.764 ns 10.795 ns 10.830 ns] change: [-40.716% -39.922% -39.255%] (p = 0.00 < 0.05) Performance has improved. cpr_nl_low_lat time: [2.2473 ns 2.2617 ns 2.2767 ns] change: [-89.576% -89.479% -89.386%] (p = 0.00 < 0.05) Performance has improved. ``` Fixes issue asmarques#3.
wiseman
added a commit
to wiseman/adsb
that referenced
this issue
Jan 22, 2021
cpr_nl was returning 0 in some cases, which could lead to panics. This change switches cpr_nl from a trigonometry-based implementation to (essentially) a table lookup. I added a couple unit tests, and a criterion benchmark for cpr_nl to validate the table-based speedup. On my machine this version is, in the worst case situation, 40% faster. In the best case it's 89% faster. ``` cpr_nl_high_lat time: [10.764 ns 10.795 ns 10.830 ns] change: [-40.716% -39.922% -39.255%] (p = 0.00 < 0.05) Performance has improved. cpr_nl_low_lat time: [2.2473 ns 2.2617 ns 2.2767 ns] change: [-89.576% -89.479% -89.386%] (p = 0.00 < 0.05) Performance has improved. ``` Fixes issue asmarques#3.
Fixed by #4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Page 47 of http://www.anteni.net/adsb/Doc/1090-WP-14-09R1.pdf says
but
cpr_nl
as currently defined can return 0.This can lead to a panic when decoding positions:
I found this by running the decoder over about 14 billion pings I've recorded from the Los Angeles area. In that many pings you get some weird data, and this one cropped up about 4 million pings into the test, where I accidentally used even and odd frames that were broadcast about 10 hours and many miles apart (and may be corrupted/weird anyway).
The text was updated successfully, but these errors were encountered: