-
Notifications
You must be signed in to change notification settings - Fork 318
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
ArrayIndexOutOfBoundsException in MapboxRouteLineUtils #4251
Comments
I've been experimenting with the actor strategy for the shared mutable state in the vanishing route line class rather than the mutex used in the route line api. https://kotlinlang.org/docs/shared-mutable-state-and-concurrency.html#actors I like the implementation however the actor class is marked with @ObsoleteCoroutinesApi. Looking at the source of the class I could write my own version since it's not very sophisticated but I'd prefer to use the kotlin version. Based on this github question and answer it doesn't appear there's much risk of the class changing. Can I go ahead and use the kotlin actor class even though it's marked @ObsoleteCoroutinesApi? |
I'd rather avoiding this. From
Also it seems that there's recent movement in Kotlin/kotlinx.coroutines#87 and Kotlin/kotlinx.coroutines#776 We had a similar discussion with |
It would be used for the vanishing route line class which external developers don't interact with. |
In any case, let's make sure they're not impacted at all. It may be situations in which clients don't interact directly with the APIs but they're forced to make changes on their side. If that's not the case, disregard this comment. |
In my opinion, using a stateful actor approach (with cancellable mailbox) or any other approach would more target to resolve #4232. To resolve this crash, we seem to be missing a synchronization step for some of the shared resources. I think we should focus on narrowing this down and resolving the crash itself, and then we can turn to something more elaborate. |
Adding the |
Closing as we think we were able to prevent the crash in #4298. We didn't have a reproducible case to confirm the fix, so let's keep an eye out for this and reopen if necessary. |
This happened again on
|
I made some modifications for the work in PR #4489 that I think would eliminate the possibility of this issue occurring. |
This issue seems to be the same as #4483 so closing this. If it's thought this is somehow different then reopen. |
Caught on
v2.0.0-beta.5
.Looks like
mapbox-navigation-android/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/internal/route/line/MapboxRouteLineUtils.kt
Line 83 in a1c8f01
didn't find an element and returned
-1
which resulted in:Can this be a regression from #4106?
routeLineExpressionData
is filled up on a worker thread, whileMapboxRouteLineApi#updateTraveledRouteLine
->VanishingRouteLine#getTraveledRouteLineExpressions
->MapboxRouteLineUtils#getTrafficLineExpression
is all done on the synchronously.I think even a call to
MapboxRouteLineApi#clearRouteLine
could trigger this race condition and clear therouteLineExpressionData
while it's being processed by the vanishing route line code.Should
MapboxRouteLineApi#updateTraveledRouteLine
also be guarded by the mutex since it accesses the shared state? Are there any other areas in the codebase like this?cc @cafesilencio @Guardiola31337 @korshaknn
The text was updated successfully, but these errors were encountered: