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 on arrival #126

Closed
ianthetechie opened this issue Jun 30, 2024 · 2 comments
Closed

Crash on arrival #126

ianthetechie opened this issue Jun 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working core Related to the Rust core iOS

Comments

@ianthetechie
Copy link
Contributor

This manifests on iOS today with the arrival view on iOS, but I'm pretty sure the root cause is the core. Here's a sample backtrace.

Last Exception Backtrace:
0   CoreFoundation                	       0x19c428f20 __exceptionPreprocess + 164
1   libobjc.A.dylib               	       0x1942da018 objc_exception_throw + 59
2   Foundation                    	       0x19b92f868 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 187
3   Foundation                    	       0x19b3af308 -[NSDateComponentsFormatter stringFromTimeInterval:] + 255
4   iOS Demo                      	       0x100424270 closure #1 in ArrivalView.body.getter + 648
5   SwiftUI                       	       0x1a0305324 0x1a03052bd + 103
6   iOS Demo                      	       0x100422cac ArrivalView.body.getter + 616
7   iOS Demo                      	       0x100429280 protocol witness for View.body.getter in conformance ArrivalView + 12

TL;DR, there's some value being passed to the DateComponentsFormatter which is causing a crash. I tried several "obvious" edge cases like zero, negative zero (the value in question is a Double), and -1. Then I remembered that there are plenty more, because doubles... like NaN, infinity, and subnormals.

I believe that something in algorithms.rs (the calculate_trip_progress function) is responsible. I have observed similar issues with doing these sorts of calcs before; sometime even traceable back to the geo rust calculations, which have on occasion not been fully implemented or sound against edge cases (any sort of IEEE-754 division is inherently unsafe.)

@ianthetechie ianthetechie added bug Something isn't working iOS core Related to the Rust core labels Jun 30, 2024
@ianthetechie ianthetechie self-assigned this Jun 30, 2024
@Archdoog
Copy link
Collaborator

Archdoog commented Jul 2, 2024

@ianthetechie Closed by #127?

@ianthetechie
Copy link
Contributor Author

Ahh yes, that should have fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Related to the Rust core iOS
Projects
None yet
Development

No branches or pull requests

2 participants