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

Crash adding annotation — -[MGLMapView visibleAnnotationsInRect:] #6901

Closed
bsudekum opened this issue Nov 3, 2016 · 3 comments
Closed
Assignees
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS release blocker Blocks the next final release
Milestone

Comments

@bsudekum
Copy link

bsudekum commented Nov 3, 2016

Platform: iOS
Mapbox SDK version: 3.4.0-beta.2

Steps to trigger behavior

  1. Add annotation

Expected behavior

The annotation is added

Actual behavior

The app crashes with

Mapbox`::-[MGLMapView visibleAnnotationsInRect:](CGRect):
    0x1041d487b <+0>:   pushq  %rbp
    0x1041d487c <+1>:   movq   %rsp, %rbp
    0x1041d487f <+4>:   pushq  %r15
    0x1041d4881 <+6>:   pushq  %r14
    0x1041d4883 <+8>:   pushq  %r13
    0x1041d4885 <+10>:  pushq  %r12
    0x1041d4887 <+12>:  pushq  %rbx
    0x1041d4888 <+13>:  subq   $0x68, %rsp
    0x1041d488c <+17>:  movq   %rdi, %rbx
    0x1041d488f <+20>:  movq   0x6b860a(%rip), %r14      ; MGLMapView._annotationContextsByAnnotationTag
    0x1041d4896 <+27>:  xorl   %r15d, %r15d
    0x1041d4899 <+30>:  cmpq   $0x0, 0x18(%rbx,%r14)
    0x1041d489f <+36>:  je     0x1041d4a19               ; <+414> at MGLMapView.mm:2847
    0x1041d48a5 <+42>:  leaq   0x10(%rbp), %rax
    0x1041d48a9 <+46>:  movq   0x6b6c40(%rip), %rdx      ; "annotationTagsInRect:"
    0x1041d48b0 <+53>:  movq   0x18(%rax), %rcx
    0x1041d48b4 <+57>:  movq   %rcx, 0x18(%rsp)
    0x1041d48b9 <+62>:  movq   0x10(%rax), %rcx
    0x1041d48bd <+66>:  movq   %rcx, 0x10(%rsp)
    0x1041d48c2 <+71>:  movq   (%rax), %rcx
    0x1041d48c5 <+74>:  movq   0x8(%rax), %rax
    0x1041d48c9 <+78>:  movq   %rax, 0x8(%rsp)
    0x1041d48ce <+83>:  movq   %rcx, (%rsp)
    0x1041d48d2 <+87>:  leaq   -0x40(%rbp), %rdi
    0x1041d48d6 <+91>:  movq   %rbx, %rsi
    0x1041d48d9 <+94>:  callq  0x1047def90               ; symbol stub for: objc_msgSend_stret
    0x1041d48de <+99>:  movq   -0x40(%rbp), %rdi
    0x1041d48e2 <+103>: movq   -0x38(%rbp), %rdx
    0x1041d48e6 <+107>: subq   %rdi, %rdx
    0x1041d48e9 <+110>: sarq   $0x2, %rdx
    0x1041d48ed <+114>: je     0x1041d49ee               ; <+371> [inlined] std::__1::__vector_base<unsigned int, std::__1::allocator<unsigned int> >::~__vector_base() + 6 at vector:457
    0x1041d48f3 <+120>: movq   0x6b7c9e(%rip), %rdi      ; (void *)0x0000000106040cd0: NSMutableArray
    0x1041d48fa <+127>: movq   0x6b5cd7(%rip), %rsi      ; "arrayWithCapacity:"
    0x1041d4901 <+134>: callq  *0x697311(%rip)           ; (void *)0x0000000105494ac0: objc_msgSend
    0x1041d4907 <+140>: movq   %rax, %rdi
    0x1041d490a <+143>: callq  0x1047defb4               ; symbol stub for: objc_retainAutoreleasedReturnValue
    0x1041d490f <+148>: movq   %rax, -0x58(%rbp)
    0x1041d4913 <+152>: movq   -0x40(%rbp), %r13
    0x1041d4917 <+156>: movq   -0x38(%rbp), %rax
    0x1041d491b <+160>: movq   %rax, -0x60(%rbp)
    0x1041d491f <+164>: cmpq   %rax, %r13
    0x1041d4922 <+167>: je     0x1041d49c8               ; <+333> at MGLMapView.mm:2843
    0x1041d4928 <+173>: addq   %r14, %rbx
    0x1041d492b <+176>: movq   %rbx, -0x68(%rbp)
    0x1041d492f <+180>: movq   %rbx, %rdi
    0x1041d4932 <+183>: movq   %r13, %rsi
    0x1041d4935 <+186>: callq  0x1041e73f0               ; std::__1::unordered_map<unsigned int, MGLAnnotationContext, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, MGLAnnotationContext> > >::operator[] at unordered_map:1531
    0x1041d493a <+191>: movq   %rax, %r12
    0x1041d493d <+194>: movq   (%r12), %rdi
    0x1041d4941 <+198>: movq   0x6972e8(%rip), %rax      ; (void *)0x0000000105491cb0: objc_retain
    0x1041d4948 <+205>: movq   %rax, %rbx
    0x1041d494b <+208>: callq  *%rbx
    0x1041d494d <+210>: movq   %rax, -0x50(%rbp)
    0x1041d4951 <+214>: movq   0x8(%r12), %rdi
    0x1041d4956 <+219>: callq  *%rbx
    0x1041d4958 <+221>: movq   %rax, -0x48(%rbp)
    0x1041d495c <+225>: movq   0x10(%r12), %rdi
    0x1041d4961 <+230>: callq  *%rbx
    0x1041d4963 <+232>: movq   %rax, %r14
    0x1041d4966 <+235>: movq   0x18(%r12), %rdi
    0x1041d496b <+240>: callq  *%rbx
    0x1041d496d <+242>: movq   %rax, %r15
    0x1041d4970 <+245>: movq   0x20(%r12), %rdi
    0x1041d4975 <+250>: callq  *%rbx
    0x1041d4977 <+252>: movq   %rax, %rbx
    0x1041d497a <+255>: movq   -0x58(%rbp), %rdi
    0x1041d497e <+259>: movq   0x6b5893(%rip), %rsi      ; "addObject:"
    0x1041d4985 <+266>: movq   -0x50(%rbp), %r12
    0x1041d4989 <+270>: movq   %r12, %rdx
    0x1041d498c <+273>: callq  *0x697286(%rip)           ; (void *)0x0000000105494ac0: objc_msgSend
->  0x1041d4992 <+279>: movq   %rbx, %rdi
    0x1041d4995 <+282>: movq   0x69728c(%rip), %rax      ; (void *)0x0000000105491d20: objc_release
    0x1041d499c <+289>: movq   %rax, %rbx
    0x1041d499f <+292>: callq  *%rbx
    0x1041d49a1 <+294>: movq   %r15, %rdi
    0x1041d49a4 <+297>: callq  *%rbx
    0x1041d49a6 <+299>: movq   %r14, %rdi
    0x1041d49a9 <+302>: callq  *%rbx
    0x1041d49ab <+304>: movq   -0x48(%rbp), %rdi
    0x1041d49af <+308>: callq  *%rbx
    0x1041d49b1 <+310>: movq   %r12, %rdi
    0x1041d49b4 <+313>: callq  *%rbx
    0x1041d49b6 <+315>: addq   $0x4, %r13
    0x1041d49ba <+319>: cmpq   %r13, -0x60(%rbp)
    0x1041d49be <+323>: movq   -0x68(%rbp), %rbx
    0x1041d49c2 <+327>: jne    0x1041d492f               ; <+180> at MGLMapView.mm:2839
    0x1041d49c8 <+333>: movq   0x6b5851(%rip), %rsi      ; "copy"
    0x1041d49cf <+340>: movq   -0x58(%rbp), %rbx
    0x1041d49d3 <+344>: movq   %rbx, %rdi
    0x1041d49d6 <+347>: callq  *0x69723c(%rip)           ; (void *)0x0000000105494ac0: objc_msgSend
    0x1041d49dc <+353>: movq   %rax, %r15
    0x1041d49df <+356>: movq   %rbx, %rdi
    0x1041d49e2 <+359>: callq  *0x697240(%rip)           ; (void *)0x0000000105491d20: objc_release
    0x1041d49e8 <+365>: movq   -0x40(%rbp), %rdi
    0x1041d49ec <+369>: jmp    0x1041d49f1               ; <+374> [inlined] std::__1::__vector_base<unsigned int, std::__1::allocator<unsigned int> >::~__vector_base() + 9 at vector:457
    0x1041d49ee <+371>: xorl   %r15d, %r15d
    0x1041d49f1 <+374>: testq  %rdi, %rdi
    0x1041d49f4 <+377>: je     0x1041d4a19               ; <+414> at MGLMapView.mm:2847
    0x1041d49f6 <+379>: movq   -0x38(%rbp), %rax
    0x1041d49fa <+383>: cmpq   %rdi, %rax
    0x1041d49fd <+386>: je     0x1041d4a14               ; <+409> [inlined] std::__1::__deallocate(void*) at memory:1722
    0x1041d49ff <+388>: leaq   -0x4(%rax), %rcx
    0x1041d4a03 <+392>: subq   %rdi, %rcx
    0x1041d4a06 <+395>: notq   %rcx
    0x1041d4a09 <+398>: andq   $-0x4, %rcx
    0x1041d4a0d <+402>: addq   %rax, %rcx
    0x1041d4a10 <+405>: movq   %rcx, -0x38(%rbp)
    0x1041d4a14 <+409>: callq  0x1047df542               ; symbol stub for: operator delete(void*)
    0x1041d4a19 <+414>: movq   %r15, %rdi
    0x1041d4a1c <+417>: addq   $0x68, %rsp
    0x1041d4a20 <+421>: popq   %rbx
    0x1041d4a21 <+422>: popq   %r12
    0x1041d4a23 <+424>: popq   %r13
    0x1041d4a25 <+426>: popq   %r14
    0x1041d4a27 <+428>: popq   %r15
    0x1041d4a29 <+430>: popq   %rbp
    0x1041d4a2a <+431>: jmp    0x1047def24               ; symbol stub for: objc_autoreleaseReturnValue
    0x1041d4a2f <+436>: movq   %rax, %r13
    0x1041d4a32 <+439>: jmp    0x1041d4a5b               ; <+480> at MGLMapView.mm:2844
    0x1041d4a34 <+441>: movq   %rax, %r13
    0x1041d4a37 <+444>: movq   %rbx, %rdi
    0x1041d4a3a <+447>: movq   0x6971e7(%rip), %rax      ; (void *)0x0000000105491d20: objc_release
    0x1041d4a41 <+454>: movq   %rax, %rbx
    0x1041d4a44 <+457>: callq  *%rbx
    0x1041d4a46 <+459>: movq   %r15, %rdi
    0x1041d4a49 <+462>: callq  *%rbx
    0x1041d4a4b <+464>: movq   %r14, %rdi
    0x1041d4a4e <+467>: callq  *%rbx
    0x1041d4a50 <+469>: movq   -0x48(%rbp), %rdi
    0x1041d4a54 <+473>: callq  *%rbx
    0x1041d4a56 <+475>: movq   %r12, %rdi
    0x1041d4a59 <+478>: callq  *%rbx
    0x1041d4a5b <+480>: movq   -0x58(%rbp), %rdi
    0x1041d4a5f <+484>: callq  *0x6971c3(%rip)           ; (void *)0x0000000105491d20: objc_release
    0x1041d4a65 <+490>: movq   -0x40(%rbp), %rdi
    0x1041d4a69 <+494>: testq  %rdi, %rdi
    0x1041d4a6c <+497>: je     0x1041d4a91               ; <+534> at new:176
    0x1041d4a6e <+499>: movq   -0x38(%rbp), %rax
    0x1041d4a72 <+503>: cmpq   %rdi, %rax
    0x1041d4a75 <+506>: je     0x1041d4a8c               ; <+529> [inlined] std::__1::__deallocate(void*) at memory:1722
    0x1041d4a77 <+508>: leaq   -0x4(%rax), %rcx
    0x1041d4a7b <+512>: subq   %rdi, %rcx
    0x1041d4a7e <+515>: notq   %rcx
    0x1041d4a81 <+518>: andq   $-0x4, %rcx
    0x1041d4a85 <+522>: addq   %rax, %rcx
    0x1041d4a88 <+525>: movq   %rcx, -0x38(%rbp)
    0x1041d4a8c <+529>: callq  0x1047df542               ; symbol stub for: operator delete(void*)
    0x1041d4a91 <+534>: movq   %r13, %rdi
    0x1041d4a94 <+537>: callq  0x1047df2c0               ; symbol stub for: _Unwind_Resume
    0x1041d4a99 <+542>: movq   %rax, %r13
    0x1041d4a9c <+545>: jmp    0x1041d4a65               ; <+490> [inlined] std::__1::__vector_base<unsigned int, std::__1::allocator<unsigned int> >::~__vector_base() at vector:457
    0x1041d4a9e <+547>: jmp    0x1041d4a2f               ; <+436> at MGLMapView.mm:2847

Related #6061

/cc @boundsj

@boundsj boundsj added iOS Mapbox Maps SDK for iOS annotations Annotations on iOS and macOS or markers on Android labels Nov 3, 2016
@boundsj boundsj self-assigned this Nov 3, 2016
@boundsj boundsj added this to the ios-v3.4.0 milestone Nov 3, 2016
@boundsj boundsj added the crash label Nov 3, 2016
@1ec5
Copy link
Contributor

1ec5 commented Nov 3, 2016

Please provide a stack trace rather than an assembly view.

@1ec5 1ec5 changed the title Fatal when adding annotation Crash adding annotation — -[MGLMapView visibleAnnotationsInRect:] Nov 3, 2016
@boundsj
Copy link
Contributor

boundsj commented Nov 3, 2016

* thread #1: tid = 0xdd2789, 0x000000010444c1ee libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x000000010444c1ee libobjc.A.dylib`objc_exception_throw
    frame #1: 0x0000000104c8238f CoreFoundation`-[__NSArrayM insertObject:atIndex:] + 1375
  * frame #2: 0x00000001031a7992 Mapbox`::-[MGLMapView visibleAnnotationsInRect:](self=<unavailable>, _cmd=<unavailable>, rect=(origin = (x = -60, y = -92), size = (width = 495, height = 851))) + 279 at MGLMapView.mm:2840 [opt]
    frame #3: 0x00000001031b1d97 Mapbox`::-[MGLMapView updateAnnotationViews](self=0x00007fbb2af1b4b0, _cmd=<unavailable>) + 482 at MGLMapView.mm:4654 [opt]
    frame #4: 0x00000001031b1628 Mapbox`::-[MGLMapView notifyMapChange:](self=0x00007fbb2af1b4b0, _cmd=<unavailable>, change=<unavailable>) + 596 at MGLMapView.mm:4613 [opt]
    frame #5: 0x00000001031ba9a5 Mapbox`MBGLView::notifyMapChange(this=<unavailable>, change=<unavailable>) + 41 at MGLMapView.mm:5062 [opt]
    frame #6: 0x00000001033d6c90 Mapbox`mbgl::Map::render(mbgl::View&) + 592
    frame #7: 0x000000010319d46e Mapbox`::-[MGLMapView glkView:drawInRect:](self=0x00007fbb2af1b4b0, _cmd=<unavailable>, view=<unavailable>, rect=(origin = (x = 0, y = 0), size = (width = 375, height = 667))) + 63 at MGLMapView.mm:881 [opt]
    frame #8: 0x0000000107de0148 GLKit`-[GLKView _display:] + 304
    frame #9: 0x000000010319dde2 Mapbox`::-[MGLMapView updateFromDisplayLink](self=<unavailable>, _cmd=<unavailable>) + 65 at MGLMapView.mm:1009 [opt]
    frame #10: 0x00000001058fbbd5 QuartzCore`CA::Display::DisplayLinkItem::dispatch(unsigned long long) + 57
    frame #11: 0x00000001058fba95 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 449
    frame #12: 0x0000000104ce3964 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    frame #13: 0x0000000104ce35f3 CoreFoundation`__CFRunLoopDoTimer + 1075
    frame #14: 0x0000000104ce317a CoreFoundation`__CFRunLoopDoTimers + 250
    frame #15: 0x0000000104cdaf01 CoreFoundation`__CFRunLoopRun + 2065
    frame #16: 0x0000000104cda494 CoreFoundation`CFRunLoopRunSpecific + 420
    frame #17: 0x000000010ce86a6f GraphicsServices`GSEventRunModal + 161
    frame #18: 0x0000000105b7af34 UIKit`UIApplicationMain + 159
    frame #19: 0x0000000102f780df Voyage`main + 111 at AppDelegate.swift:13
    frame #20: 0x0000000108aa968d libdyld.dylib`start + 1
    frame #21: 0x0000000108aa968d libdyld.dylib`start + 1

@boundsj boundsj added the release blocker Blocks the next final release label Nov 4, 2016
@boundsj
Copy link
Contributor

boundsj commented Nov 4, 2016

This was fixed in #6924 that is currently in the 3.4.0 release branch and will be in the next iOS beta for 3.4.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS release blocker Blocks the next final release
Projects
None yet
Development

No branches or pull requests

3 participants