'terminating with uncaught exception of type std::domain_error: latitude must be between -90 and 90'

Hello, we get this error during chevron position update. It suggests that the latitude is outside of the acceptable range, but the matchedLocation obtained from MatcherListener which is used for update is correct (we checked).

The error happens randomly during navigation, we can’t get it to reproduce consistently but it can happen quite often (every 10 minutes or so).

Here is how we update chevron position:

fun updateChevronPosition(
    isMatched: Boolean,
    matchedLocation: Location,
    originalLocation: Location
) {
    val chevronPosition = ChevronPosition.Builder(matchedLocation).build()
    chevron?.apply {
        isDimmed = !isMatched
        position = chevronPosition
    }
}

All three arguments are taken from MatchResult object returned from:

matcher?.setMatcherListener(object : MatcherListener {
    override fun onMatched(matchResult: MatchResult) {
        onMatched(matchResult)
    }
}

which uses map itself as a matching data provider.

Here is a full error message:

2022-05-05 11:23:29.764 15412-15412/<package-name> A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15412 (<package-name>), pid 15412 (<package-name>)
2022-05-05 11:23:29.881 17176-17176/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-05-05 11:23:29.881 17176-17176/? A/DEBUG: Build fingerprint: 'samsung/gts7leea/gts7l:11/RP1A.200720.012/T875XXU2BUF5:user/release-keys'
2022-05-05 11:23:29.881 17176-17176/? A/DEBUG: Revision: '7'
2022-05-05 11:23:29.881 17176-17176/? A/DEBUG: ABI: 'arm64'
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG: Timestamp: 2022-05-05 11:23:29+0200
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG: pid: 15412, tid: 15412, name: <package-name>  >>> <package-name> <<<
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG: uid: 10351
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG: Abort message: 'terminating with uncaught exception of type std::domain_error: latitude must be between -90 and 90'
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x0  0000000000000000  x1  0000000000003c34  x2  0000000000000006  x3  0000007fe551fd60
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x4  fefefefefeff2f38  x5  fefefefefeff2f38  x6  fefefefefeff2f38  x7  7f7f7f7f7f7f7f7f
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x8  00000000000000f0  x9  ac1c03ba043b88b5  x10 0000000000000000  x11 ffffffc0fffffbdf
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x12 0000000000000001  x13 0000000062739791  x14 001c7170e92082f2  x15 00004c7a3f3f82b3
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x16 0000007c1ca5e948  x17 0000007c1ca3b440  x18 0000007ae74eee90  x19 0000000000003c34
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x20 0000000000003c34  x21 00000000ffffffff  x22 ffffff80ffffffc8  x23 0000007fe551ffb0
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x24 0000007fe551fe90  x25 0000007fe551fed0  x26 0000007fe55205a8  x27 0000000000000001
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     x28 0000000000000005  x29 0000007fe551fde0
2022-05-05 11:23:29.882 17176-17176/? A/DEBUG:     lr  0000007c1c9eae78  sp  0000007fe551fd40  pc  0000007c1c9eaea4  pst 0000000000001000
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG: backtrace:
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #00 pc 000000000008cea4  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 72bf79ff636decb4f24a88c1b61c3063)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #01 pc 0000000000b7dde8  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #02 pc 0000000000b7df40  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #03 pc 0000000000b7ae30  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #04 pc 0000000000b7a45c  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #05 pc 0000000000b7a3b8  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (__cxa_throw+112) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #06 pc 00000000003fe8e4  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #07 pc 000000000048ce88  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (:<package-name>()+140) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #08 pc 00000000009c8b0c  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (uv__run_timers+36) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #09 pc 00000000009cb9c8  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (uv_run+148) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #10 pc 0000000000407820  /data/app/~~I0pDll-iEm4gYEch4chL_A==/com.example.<package-name>-9o_0t3udEGKog-49hNTYTw==/base.apk!libmapssdk-android.so (offset 0x428a000) (Java_com_tomtom_core_maps_NativeMapViewImpl_nativeRender+252) (BuildId: 9c4b1d4048ea0bf7e2111af30edd4e01de12dcb8)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #11 pc 000000000013ded4  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 97c0e38e207e755f94142b70aaeb6c27)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #12 pc 00000000020f4fa0  /memfd:jit-cache (deleted) (offset 0x2000000) (com.tomtom.core.maps.NativeMapViewImpl.render+48)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #13 pc 00000000020f7e44  /memfd:jit-cache (deleted) (offset 0x2000000) (com.tomtom.online.sdk.map.ap.render+68)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #14 pc 00000000020f77d0  /memfd:jit-cache (deleted) (offset 0x2000000) (com.tomtom.online.sdk.map.MapView.lambda$new$7$MapView+96)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #15 pc 00000000020f7eec  /memfd:jit-cache (deleted) (offset 0x2000000) (com.tomtom.online.sdk.map.MapView$$ExternalSyntheticLambda7.onRenderRequested+60)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #16 pc 00000000020f615c  /memfd:jit-cache (deleted) (offset 0x2000000) (com.tomtom.online.sdk.map.aj$a.doFrame+140)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #17 pc 00000000020f0310  /memfd:jit-cache (deleted) (offset 0x2000000) (android.view.Choreographer$CallbackRecord.run+160)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #18 pc 00000000020e8744  /memfd:jit-cache (deleted) (offset 0x2000000) (android.view.Choreographer.doCallbacks+564)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #19 pc 00000000020ed6c4  /memfd:jit-cache (deleted) (offset 0x2000000) (android.view.Choreographer.doFrame+964)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #20 pc 00000000020f3124  /memfd:jit-cache (deleted) (offset 0x2000000) (android.view.Choreographer$FrameDisplayEventReceiver.run+84)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #21 pc 00000000020cd864  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Handler.handleCallback+68)
2022-05-05 11:23:30.156 17176-17176/? A/DEBUG:       #22 pc 00000000020cdd30  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Handler.dispatchMessage+64)

Have you tried to check what value is causing this?

Yes, as I said, we checked all values used to update chevron position and crashes happens even if value is correct (between -90 and 90).