mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
860 stars 310 forks source link

[Bug]: EXC_BAD_ACCESS crash on NavigationMapView.removeRoutes() #4695

Closed JanTG1 closed 1 week ago

JanTG1 commented 1 month ago

Mapbox Navigation SDK version

3.2.0

Steps to reproduce

  1. Use Mapbox Navigation UI to follow step by step navigation
  2. Select route alternative on the map

Expected behavior

The Navigator should select the new route and remove all unneeded alternatives

Actual behavior

The app crashes due to "Thread 1: EXC_BAD_ACCESS (code=1, address=0x74786564)" while the navigator tries to clear all routes from the map view.

It happened only once, but I did not call removeRoutes myself, so it has to be the navigator that ran it. I believe it is a concurrency issue as I have had similar crashes before and it was usually an issue with multiple functions accessing the same variable at the same time. The exact line of the crash is line 476 on NavigationMapView.swift: routes = nil.

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

one-time

kried commented 1 month ago

Hi @JanTG1

Thank you for the report. We will investigate the issue. Could you please answer some additional questions?

Did you use NavigationViewController while the crash happened? Did it happen during active guidance?

JanTG1 commented 1 month ago

Yes, I am using NavigationViewController and that was also the case when the crash happened. It happened during active guidance. I was in the "overview" camera and selected a route alternative. Usually, this works without any issues, but that time it crashed when selecting the alternative.

kried commented 1 week ago

Hi @JanTG1 Could you please try the same behavior with v3.3.1 Nav SDK?

JanTG1 commented 1 week ago

@kried it hasn't happened since, and I have updated to 3.3.1 as soon as it came out. I would propose to close the issue and re-open it in case it comes up again...