【问题标题】:VectorKit crash reports with MKMapSnapshotter on iOS在 iOS 上使用 MKMapSnapshotter 的 VectorKit 崩溃报告
【发布时间】:2013-12-07 04:58:30
【问题描述】:

我收到了与VectorKitMKMapSnapShotter 相关的不同类型的崩溃报告。崩溃的发生非常随机,但似乎它们在从后台返回时发生得最多。设备在发生之前不会发出任何内存警告。

这里发生了什么?

我正在使用:

if (!_snapshotQueue) {
    _snapshotQueue = dispatch_queue_create("com.bestappever.snapshot", DISPATCH_QUEUE_SERIAL);
}
[_snapshotter cancel]
_snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options];
__weak __typeof(self)__self = self;
[_snapshotter startWithQueue:queue completionHandler:^(MKMapSnapshot *snapshot, NSError *error) {
    dispatch_async(dispatch_get_main_queue(), ^{
        __strong __typeof(__self)_self = __self;
        [_self doSomething];
    });
}];

最常见的如下:

Thread 11 Crashed:
0   libobjc.A.dylib                      0x38502b66 objc_msgSend + 5
1   VectorKit                            0x35bc8997 -[VKTileProvider changeTileForKey:toState:withMetadata:withTile:forLayer:] + 51
2   VectorKit                            0x35c1f88d -[VKTileProvider tileSource:invalidateKeys:] + 168
3   VectorKit                            0x35c41325 -[VKTileSource didFailToLoadTileKey:error:] + 196
4   GeoServices                          0x32ca906b ___ZN8LoadItem15deleteRequesterEP8NSStringbb_block_invoke + 87
5   libdispatch.dylib                    0x389ec0c3 _dispatch_call_block_and_release + 11
6   libdispatch.dylib                    0x389f0e7b _dispatch_queue_drain + 375
7   libdispatch.dylib                    0x389edf93 _dispatch_queue_invoke + 43
8   libdispatch.dylib                    0x389f1745 _dispatch_root_queue_drain + 77
9   libdispatch.dylib                    0x389f19c5 _dispatch_worker_thread2 + 57
10  libsystem_pthread.dylib              0x38b1bdff _pthread_wqthread + 298
11  libsystem_pthread.dylib              0x38b1bcc4 start_wqthread + 8

其他一些例子:

Thread 11 Crashed:
0   libobjc.A.dylib                      0x3850a7aa lookUpImpOrForward + 94
1   libobjc.A.dylib                      0x3850302b _class_lookupMethodAndLoadCache3 + 35
2   libobjc.A.dylib                      0x38502df9 _objc_msgSend_uncached + 25
3   VectorKit                            0x35bc8997 -[VKTileProvider changeTileForKey:toState:withMetadata:withTile:forLayer:] + 50
4   VectorKit                            0x35bc895d -[VKTileProvider tileSource:didFetchTile:forKey:] + 60
5   VectorKit                            0x35bc8915 -[VKTileSource fetchedTile:forKey:] + 44
6   VectorKit                            0x35bc9a95 -[VKTileSetBackedTileSource fetchedTile:forKey:] + 212
7   VectorKit                            0x35bc889d -[VKTileSource _fetchedTile:] + 224
8   VectorKit                            0x35bc8409 __49-[VKTileSource decodeData:downloadKey:sourceKey:]_block_invoke_3 + 109
9   libdispatch.dylib                    0x389ec0c3 _dispatch_call_block_and_release + 11
10  libdispatch.dylib                    0x389f0e7b _dispatch_queue_drain + 375
11  libdispatch.dylib                    0x389edf93 _dispatch_queue_invoke + 43
12  libdispatch.dylib                    0x389f1745 _dispatch_root_queue_drain + 77
13  libdispatch.dylib                    0x389f19c5 _dispatch_worker_thread2 + 57
14  libsystem_pthread.dylib              0x38b1bdff _pthread_wqthread + 298
15  libsystem_pthread.dylib              0x38b1bcc4 start_wqthread + 8


Thread 6 Crashed:
0   libsystem_kernel.dylib               0x390a41fc __pthread_kill + 8
1   libsystem_c.dylib                    0x39054ffd abort + 76
2   Ding Dong                            0x00090de7 uncaught_exception_handler + 27
3   CoreFoundation                       0x2e6a524f __handleUncaughtException + 579
4   libobjc.A.dylib                      0x38ae590f _objc_terminate() + 175
5   libc++abi.dylib                      0x3839a1c7 std::__terminate(void (*)()) + 79
6   libc++abi.dylib                      0x38399a1d __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 1
7   libobjc.A.dylib                      0x38ae5783 objc_exception_throw + 250
8   CoreFoundation                       0x2e6a88e7 -[NSObject doesNotRecognizeSelector:] + 202
9   CoreFoundation                       0x2e6a71cb ___forwarding___ + 707
10  CoreFoundation                       0x2e5f64d8 _CF_forwarding_prep_0 + 24
11  VectorKit                            0x36077cb9 -[VKTileProvider tileSource:keyIsNeeded:] + 68
12  VectorKit                            0x36077c2b -[VKTileSource _shouldDecodeTile:] + 178
13  VectorKit                            0x36077a91 -[VKTileSource didFetchData:forKey:] + 108
14  GeoServices                          0x3319a087 ___ZNK49-[GEOTileLoaderInternal _loadedTile:forKey:info:]66__49-[GEOTileLoaderInternal _loadedTile:forKey:info:]_block_invoke3$_1clERKN8LoadItem9RequesterE_block_invoke_2 + 55
15  libdispatch.dylib                    0x38fc8d1b _dispatch_call_block_and_release + 11
16  libdispatch.dylib                    0x38fcf273 _dispatch_queue_drain$VARIANT$mp + 375
17  libdispatch.dylib                    0x38fcf06b _dispatch_queue_invoke$VARIANT$mp + 43
18  libdispatch.dylib                    0x38fcfce1 _dispatch_root_queue_drain + 77
19  libdispatch.dylib                    0x38fcff59 _dispatch_worker_thread2 + 57
20  libsystem_pthread.dylib              0x3910adbf _pthread_wqthread + 298
21  libsystem_pthread.dylib              0x3910ac84 start_wqthread + 8

Thread 16 Crashed:
0   VectorKit                            0x35a36476 std::__1::__hash_iterator<std::__1::__hash_node<std::__1::pair<VKTileKey, void const*>, void*>*> std::__1::__hash_table<std::__1::pair<VKTileKey, void const*>, std::__1::__unordered_map_hasher<VKTileKey, void const*, hashkey, true>, std::__1::__unordered_map_equal<VKTileKey, void const*, eqkey, true>, vk_allocator<std::__1::pair<VKTileKey, void const*> > >::find<VKTileKey>(VKTileKey const&) + 54
1   VectorKit                            0x35a3642d -[VKTileKeyMap objectForKey:] + 24
2   VectorKit                            0x35a3a837 -[VKTileKeyList containsKey:] + 34
3   VectorKit                            0x35a54b9f -[VKTileProvider tileMatters:] + 78
4   VectorKit                            0x35a549c1 -[VKTileProvider changeTileForKey:toState:withMetadata:withTile:forLayer:] + 92
5   VectorKit                            0x35a5495d -[VKTileProvider tileSource:didFetchTile:forKey:] + 60
6   VectorKit                            0x35a54915 -[VKTileSource fetchedTile:forKey:] + 44
7   VectorKit                            0x35a5489d -[VKTileSource _fetchedTile:] + 224
8   VectorKit                            0x35a54409 __49-[VKTileSource decodeData:downloadKey:sourceKey:]_block_invoke_3 + 109
9   libdispatch.dylib                    0x388780c3 _dispatch_call_block_and_release + 11
10  libdispatch.dylib                    0x3887ce7b _dispatch_queue_drain + 375
11  libdispatch.dylib                    0x38879f93 _dispatch_queue_invoke + 43
12  libdispatch.dylib                    0x3887d745 _dispatch_root_queue_drain + 77
13  libdispatch.dylib                    0x3887d9c5 _dispatch_worker_thread2 + 57
14  libsystem_pthread.dylib              0x389a7dff _pthread_wqthread + 298
15  libsystem_pthread.dylib              0x389a7cc4 start_wqthread + 8

【问题讨论】:

  • 我遇到了类似的问题,我认为这可能与后台的 OpenGL 绘图有关,我听说这可能会导致问题。我希望对这种事情有更多了解的人可以回答。
  • 我刚刚在启动带有调试器的应用程序时发生了崩溃,所以它也发生在重新启动时。探索寄存器没有给我任何提示。
  • 我也遇到了 VectorKit 的崩溃问题,但缺乏任何有关 VK 的文档使得故障排除变得更加困难。如果有任何关于导致 VectorKit 发生各种崩溃的原因的在线信息来源,将会很有帮助。
  • 我看到了涉及 MKMapSnapshotter 的各种崩溃:openradar.me/15351647 从 iOS 7.1 beta 5 开始,此 API 尚未准备好用于生产使用 IMO。
  • 这种情况还在发生吗?你打开僵尸了吗?

标签: ios ios7 mapkit mkmapsnapshotter


【解决方案1】:

这有多可重复?设备是否退出睡眠模式?当应用程序进入后台时,屏幕上会显示什么?

ViewController 中,您可以尝试注册NSNotification 事件UIApplicationWillResignActiveNotification

当应用程序进入后台时,在任何MKMapSnapshotter 上调用取消

如果这不起作用,您可以尝试更严厉的措施,例如隐藏视图,以确定它们是否与崩溃有关。

【讨论】:

  • 我发现很难在本地复制,但它在生产中相对经常出现。
【解决方案2】:

我遇到了同样的问题,频繁但随机的崩溃通常看起来像:

VectorKit 0x10663fe9 -[VKTileProvider tileSource:didFetchTile:forKey:] + 105

我通过删除这一行来修复它:

this.mapSnapshotter.Cancel();

所以我认为 Apple 的 MKMapSnapshotter Cancel 方法存在错误。

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-30
    相关资源
    最近更新 更多