mapbox / mapbox/mapbox-navigation-android
Memory address error when rapidly invocing mapboxNavigation.onDestroy, create new instance, mapboxNavigation.setRoutes
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
Android API: 29
Mapbox Navigation SDK version: 1.5.1
Steps to trigger behavior
The crash can be triggered by rapid re-invocation of the below method:
private fun destroyMapboxNavigationAndSetRoute(routes: List<DirectionsRoute>){
//destroy MapboxNavigation
mapboxNavigation!!.onDestroy()
//recreate MapboxNavigation
val mapboxNavigationOptions = MapboxNavigation
.defaultNavigationOptionsBuilder(this, getString(R.string.mapbox_access_token))
.build()
mapboxNavigation = MapboxNavigation(mapboxNavigationOptions)
//try to set Routes to new MapboxNavigation
mapboxNavigation!!.setRoutes(routes)
}
Please also see my example that displays the crashing behaviour when rapidly clicking the FloatingActionButton.
It results in A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 in tid 13329 (Thread-56), pid 12957.
Expected behavior
No crash.
Actual behavior
2021-10-18 14:30:33.703 12957-13329/com.example.ablynavigationbug A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 in tid 13329 (Thread-56), pid 12957 (lynavigationbug)
2021-10-18 14:30:33.712 1805-2288/? E/GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
2021-10-18 14:30:33.712 1805-2288/? E/GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
2021-10-18 14:30:33.844 13359-13359/? I/crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2021-10-18 14:30:33.844 1871-1871/? I//system/bin/tombstoned: received crash request for pid 13329
2021-10-18 14:30:33.846 13359-13359/? I/crash_dump32: performing dump of process 12957 (target tid = 13329)
2021-10-18 14:30:33.851 13359-13359/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-10-18 14:30:33.851 13359-13359/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:10/QSR1.190920.001/5891938:user/release-keys'
2021-10-18 14:30:33.851 13359-13359/? A/DEBUG: Revision: '0'
2021-10-18 14:30:33.851 13359-13359/? A/DEBUG: ABI: 'x86'
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: Timestamp: 2021-10-18 14:30:33+0200
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: pid: 12957, tid: 13329, name: Thread-56 >>> com.example.ablynavigationbug <<<
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: uid: 10154
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: Cause: null pointer dereference
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: eax 00000030 ebx e956bc34 ecx 00000030 edx 00000000
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: edi 00000030 esi 00000000
2021-10-18 14:30:33.863 13359-13359/? A/DEBUG: ebp a6b78eb8 esp a6b78e80 eip e956172f
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: backtrace:
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #00 pc 0011b72f /apex/com.android.runtime/lib/bionic/libc.so (pthread_mutex_lock+31) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #01 pc 00133640 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libmapbox-common.so (offset 0x2d000) (std::__ndk1::mutex::lock()+32) (BuildId: 49dca947f7713ef8f89b5dcff9c66d9421b39bc3)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #02 pc 0028e317 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #03 pc 0028e026 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #04 pc 002b5d01 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #05 pc 002b6319 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #06 pc 00284eac /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #07 pc 002b66d3 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #08 pc 002ec417 /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #09 pc 002ecf9d /data/app/com.example.ablynavigationbug-UD15Zf74e9d2vOQTP9zuWg==/base.apk!libnavigator-android.so (offset 0x988000) (BuildId: 2de323ea4a7ac48089862a92b70bef08a6374934)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #10 pc 0011a8e5 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+53) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
2021-10-18 14:30:33.864 13359-13359/? A/DEBUG: #11 pc 000af6a7 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the rapid FloatingActionButton sequence from NavigationBug.zip on Android API 29 with Mapbox Navigation SDK 1.5.1, focusing on destroyMapboxNavigationAndSetRoute and its onDestroy, recreation, and setRoutes calls. Use the supplied SIGSEGV backtrace to trace the lifecycle interaction; done means the sequence no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100