-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Crash on render with view-backed annotations present — -[MGLMapView visibleAnnotationsInRect:] #8163
Comments
Sorry to hear you are having issues @ollie-eman. Can you please tell us what version of our iOS SDK you were using before you updated to A similar issue was reported in #6901 and #7170 but that seemed to be resolved by #6924 that landed in version 3.4.0 of our iOS SDK. Before #6924, an action like panning the map while concurrently removing annotations that are being updated to track the pan gesture could cause this crash. We can add more guards around the NSArray |
The version I was using before I don't have any reproducible steps I'm afraid, from the crash reports it effects each user roughly 1.3 times. The app is similar to Pokemon Go, the user is in the centre of the map and there are two available gestures. These are rotating the camera around the user and pinch to zoom and tilt the camera. When the user moves location I make changes to the current The map shows annotations that represent parcels the user has to tap, these get updated regularly (every 10 seconds). I use the following code to update the annotations on the map. The class func processIncomingAnnotations(_ incomingAnnotations: [DefaultPointAnnotation], existingAnnotations: [DefaultPointAnnotation]) {
var annotationsToKeep = [DefaultPointAnnotation]()
// for each of the incoming annotations
incomingAnnotations.forEach { incomingAnnotation in
// if the annotation already exists on the map, keep it for now
if existingAnnotations.contains(incomingAnnotation) {
annotationsToKeep.append(incomingAnnotation)
}
else {
// otherwise it's new, so add it
mapView?.addAnnotation(incomingAnnotation)
}
}
// for each existing annotation on the map
existingAnnotations.forEach { existingAnnotation in
// if it does not match one of the duplicates from the incoming, remove it
if !annotationsToKeep.contains(existingAnnotation) {
mapView?.removeAnnotation(existingAnnotation)
}
}
} |
Thanks for the information @ollie-eman. We spent some time investigating and still cannot find a code path that would lead to the crash you are seeing. We will keep digging but if you can provide any more information that may help we would appreciate it. Some things that may be useful to know are:
|
|
I'm leaving this issue open, but since there is no known repro yet I'm going to move this off of the 3.5.0 milestone. |
We're experiencing this same crash as of 3.4.1. We were previously on 3.3.7. We use both view-backed and GL-backed annotations depending on the screen.
|
Since @ollie-eman @erichoracek, can you check whether this crash still occurs after upgrading to iOS SDK v3.5.0? Thanks! |
I got same issue on ios-v3.5.0 |
It usually occurred when a user rapidly repeat to use double-tap feature. |
Thanks for the information @Laeyoung we investigated before the code path that lead to this crash but we weren't able to reproduce it, is there any code snipet or test app you can share with us? that help us reproduce this consistently. |
I'm still seeing this crash after upgrading to version |
@fabian-guerra I tried to make a test app which has same issue, but I failed.... One thing I can sure is that it didn't occur when I remove all Mapview.revmoeAnnotations() function calls. |
Noting that a stopgap landed in #8513 for the iOS v3.5.1 patch release but we will move this issue to the iOS v3.6.0 release and continue to investigate the root cause. |
Here’s one possible way to get a similar crash; there may be others:
#8513 papers over the crash by gracefully failing, but I think that just kicks the can down the road. We should supplement that fix with an assertion similar to this assertion in the accessibility code. That way we’ll at least get a more specific crash and the ability to rule out the /cc @fabian-guerra |
@ollie-eman @Laeyoung since it has been difficult reproduce the code that lead to the crash, maybe it's better to try to reproduce the steps in the actual apps, is it possible to you share your apps (the Appstore link) + the device type & OS version? |
@fabian-guerra I reproduced this issue on my iPhone 5 (os v10.2). And my colleagues got same issues on their various iPhones. https://itunes.apple.com/us/app/alleys-video-map-vr-travel/id1123458416?mt=8 |
@fabian-guerra @1ec5 I'm able to reproduce this exact issue by removing all annotations that were added to the map at about the same time but just barely before tapping the map around some annotations and note: you must run in release or comment out the assertion
The problem is that, when annotations are removed, Unfortunately, I think that the guard added in #8513 must stay for now. |
Also, I think that while it is true that #8163 (comment) could happen in theory, it is unlikely because of the extremely high value of |
Your reproduction steps make a lot more sense than mine. 😄
This is also a bug; I think this crash also demonstrates that we should eliminate the use of
👍 As long as defensive guards like that are accompanied by assertions, and as long as we eliminate the unchecked use of |
Implemented in #8637. |
Platform: iOS
Mapbox SDK version: 3.4.1
Steps to trigger behaviour
Updated to the latest SDK version and get this error, it has effected over 1000 users in the past 7 days. Could you help me understand it so I can get a fix deployed?
I've got quite a few more reports if you need more than one?
Thanks,
Ollie
The text was updated successfully, but these errors were encountered: