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

[Bug]: RouteProgress.update(using:) causes fatal crash during navigation #4738

Open
JanTG1 opened this issue Dec 2, 2024 · 1 comment
Open
Labels
bug Something isn’t working

Comments

@JanTG1
Copy link

JanTG1 commented Dec 2, 2024

Mapbox Navigation SDK version

3.4.0

Steps to reproduce

Start a navigation and drive around.

Expected behavior

The App should not crash during simple navigation.

Actual behavior

The App crashes on most of my trips. The time of the crash is pretty random, but most navigation sessions that are longer than 10 minutes experience a crash. Here is the Thread that crashed in the Logs:

Thread 28 Crashed:
0   libsystem_kernel.dylib        	0x00000001e363d1d4 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x000000021b7aaef8 pthread_kill + 268 (pthread.c:1721)
2   libsystem_c.dylib             	0x000000019b02fad8 abort + 128 (abort.c:122)
3   libswiftCore.dylib            	0x0000000191c151a4 swift::fatalErrorv(unsigned int, char const*, char*) + 136 (Errors.cpp:398)
4   libswiftCore.dylib            	0x0000000191c151c4 swift::fatalError(unsigned int, char const*, ...) + 32 (Errors.cpp:406)
5   libswiftCore.dylib            	0x0000000191c209ac swift_deallocClassInstance + 308 (HeapObject.cpp:869)
6   libswiftCore.dylib            	0x0000000191c2083c _swift_release_dealloc + 56 (HeapObject.cpp:847)
7   libswiftCore.dylib            	0x0000000191c21950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 (RefCount.h:0)
8   APP NAME                         	0x0000000104cb66fc RouteProgress.update(using:) + 620 (/<compiler-generated>:0)
9   APP NAME                          	0x0000000104c8ad90 MapboxNavigator.updateIndices(status:) + 328 (MapboxNavigator.swift:689)
10  APP NAME                          	0x0000000104c891b1 MapboxNavigator.update(to:) + 1 (MapboxNavigator.swift:559)
11  APP NAME                          	0x00000001045deae5 $sxIeAgHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TQ0_ + 1 (/<compiler-generated>:0)
12  APP NAME                          	0x00000001045e220d closure #1 in closure #1 in CarPlayManager.defaultTripPreviewBackButton() + 1
13  APP NAME                          	0x00000001045c34e1 partial apply for closure #1 in CarPlayManager.beginNavigationWithCarPlay(using:) + 1 (/<compiler-generated>:0)
14  APP NAME                          	0x00000001045e220d closure #1 in closure #1 in CarPlayManager.defaultTripPreviewBackButton() + 1
15  libswift_Concurrency.dylib    	0x000000019e983e39 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:497)

After debugging a bit and trying to understand the logs, it seems to me as if the mutating func update(using status: NavigationStatus) func from the MapboxNavigation Library is responsible for the crash. The crash log shows involvement of swift_deallocClassInstance and _swift_release_dealloc. This suggests a deallocated object is being accessed. It could also be a threading issue, if RouteProgress.update(using:) is being called on multiple threads simultaneously, race conditions could corrupt route.legs or routeAlerts.

I hope you quickly find the cause of the crash because it is very repeatable and the crash is breaking the functionality of my app. Reach out to me if you need more information or the complete crash logs.

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

repeatable

@JanTG1 JanTG1 added the bug Something isn’t working label Dec 2, 2024
@JanTG1
Copy link
Author

JanTG1 commented Dec 14, 2024

Update: It still occurs regularly, but not on all navigation sessions. Since then I also updated to Mapbox Navigation 3.5.0, which also caused the same issue, and later to Mapbox Navigation 3.6.0-beta.1, where it also happened once so far. It is really hard to debug for me as well because many of the crashes don't produce any crashlogs, but I assume that they are all related to this issue, as all logs I have point to the RouteProgress.update call.

Hope to get an update on this soon as it is crucial for the functionality of my app and is broken on my production branch. I don't know what the last functioning version was...

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

No branches or pull requests

1 participant