Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[iOS] random crash on annotation selection #3284

Closed
RomainQuidet opened this issue Dec 14, 2015 · 7 comments
Closed

[iOS] random crash on annotation selection #3284

RomainQuidet opened this issue Dec 14, 2015 · 7 comments
Assignees
Labels
crash iOS Mapbox Maps SDK for iOS
Milestone

Comments

@RomainQuidet
Copy link
Contributor

Use the demo app, long press to add dropped annotations. After 3/4 annotations added, a selection went wrong and crashed:

2015-12-14 17:47:40.186 Mapbox GL[54555:1345769] *** Assertion failure in -[MGLMapView handleSingleTapGesture:], /Users/mappy/Documents/mapbox-gl-native/platform/ios/MGLMapView.mm:1142
2015-12-14 17:47:40.203 Mapbox GL[54555:1345769] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot select nonexistent annotation with tag -252933991'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010d782e65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010d154deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010d782cca +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x000000010cc784de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4   Mapbox GL                           0x000000010ba3a343 -[MGLMapView handleSingleTapGesture:] + 1507
    5   UIKit                               0x000000010e31ae73 _UIGestureRecognizerSendTargetActions + 153
    6   UIKit                               0x000000010e3174e5 _UIGestureRecognizerSendActions + 162
    7   UIKit                               0x000000010e3154e2 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 843
    8   UIKit                               0x000000010e31d9a0 ___UIGestureRecognizerUpdate_block_invoke904 + 79
    9   UIKit                               0x000000010e31d83e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 342
    10  UIKit                               0x000000010e30b101 _UIGestureRecognizerUpdate + 2634
    11  CoreFoundation                      0x000000010d6ae367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    12  CoreFoundation                      0x000000010d6ae2d7 __CFRunLoopDoObservers + 391
    13  CoreFoundation                      0x000000010d6a3f2b __CFRunLoopRun + 1147
    14  CoreFoundation                      0x000000010d6a3828 CFRunLoopRunSpecific + 488
    15  GraphicsServices                    0x00000001100b4ad2 GSEventRunModal + 161
    16  UIKit                               0x000000010de32610 UIApplicationMain + 171
    17  Mapbox GL                           0x000000010b5b3dff main + 111
    18  libdyld.dylib                       0x00000001106c692d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS crash labels Dec 14, 2015
@friedbunny
Copy link
Contributor

/cc @1ec5

@1ec5
Copy link
Contributor

1ec5 commented Dec 15, 2015

I haven’t encountered this crash yet, but it seems to indicate that AnnotationManager::getPointAnnotationsInBounds() returned a bogus annotation ID.

@1ec5
Copy link
Contributor

1ec5 commented Dec 15, 2015

The assertion message was using the wrong format specifier. I corrected that in c3fe62f; I think that’ll help us understand (for instance) how many annotations mbgl thinks got added.

@maciekish
Copy link
Contributor

We have the same issue. We can provide steps to recreate in a production app if that helps at all.

@maciekish
Copy link
Contributor

@1ec5 It happens in hitta.se If you zoom in to the hospital in the video, tap the annotation to reveal the callout, long press on the callout to drop a pin and then tap the original annotation it crashes with the same message as the original poster. Video http://s.swic.name/eyb4

@Zakay
Copy link

Zakay commented Feb 10, 2016

Steps to reproduce:

  1. Drop pin 1 anywhere
  2. Drop pin 2 anywhere
  3. Tap on pin 1
  4. Drop pin 3 anywhere
  5. Tap on pin 1

1ec5 added a commit that referenced this issue Feb 10, 2016
Handle the case where the currently selected annotation isn’t one of the nearby annotations. This hasn’t come up before on OS X because clicking an annotation while another annotation is selected only dismisses the callout popover.

Fixes #3284.
@1ec5
Copy link
Contributor

1ec5 commented Feb 10, 2016

Fixed in #3881. The fix will be included in 3.1.1, which will be out shortly.

@1ec5 1ec5 closed this as completed Feb 10, 2016
@1ec5 1ec5 removed the in progress label Feb 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

5 participants