Skip to content

[Bug]: Double value cannot be converted to Int because it is either infinite or NaN #4830

Description

@dmitry-yashkin

Mapbox Navigation SDK version

3.23.0

Steps to reproduce

Thread 0 Crashed:
0   Rever                         	0x0000000101269140 Swift runtime failure: Double value cannot be converted to Int because it is either infinite or NaN + 0 (RouteProgress.swift:243)
1   Rever                         	0x0000000101269140 RouteProgress.averageCongestionLevelRemainingOnLeg.getter + 1804
2   Rever                         	0x0000000101698f3c CarPlayNavigationViewController.progressDidChange(_:) + 1032 (CarPlayNavigationViewController.swift:735)
3   Rever                         	0x0000000101698340 closure #</span>1 in CarPlayNavigationViewController.observeNotifications() + 368 (CarPlayNavigationViewController.swift:689)
4   Combine                       	0x00000001b4e0ee18 Subscribers.Sink.receive(_:) + 92 (Sink.swift:128)
5   Combine                       	0x00000001b4e0edac protocol witness for Subscriber.receive(_:) in conformance Subscribers.Sink<A, B> + 24 (<compiler-generated>:0)
6   Combine                       	0x00000001b4e18fc4 CurrentValueSubject.Conduit.offer(_:) + 764 (CurrentValueSubject.swift:153)
7   Combine                       	0x00000001b4e17bbc <deduplicated_symbol> + 60
8   Combine                       	0x00000001b4e2875c partial apply for thunk for @callee_guaranteed (@guaranteed ConduitBase<A, B>) -> (@error @owned Error) + 32 (<compiler-generated>:0)
9   libswiftCore.dylib            	0x000000019a2c6d60 Sequence.forEach(_:) + 756 (Sequence.swift:820)
10  Combine                       	0x00000001b4e0ed60 ConduitList.forEach(_:) + 240 (Conduit.swift:79)
11  Combine                       	0x00000001b4e0ebdc CurrentValueSubject.send(_:) + 348 (CurrentValueSubject.swift:92)

Expected behavior

The framework doesn't crash.

Actual behavior

It seems RouteStepProgress.fractionTraveled was set to infinite or NaN and it caused a crash in RouteProgress.averageCongestionLevelRemainingOnLeg when calculating a value for the local variable coordinatesLeftOnStepCount.

Is this a one-time issue or a repeatable issue?

repeatable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions