陈健 Mark
陈健 Mark

Reputation: 351

Mapkit MapView VectorKit Crash on iOS13

As iOS13 release, there are more and more mapKit VectorKit crashes on the app which we are working on. We can not reproduce the crash internally and there are over 200 crashes collected by our own crash reporter everyday.

From all the information we have got, the crash always happens when the application come to active from background, and at that time, the ViewController view has a MKMapView subview. Maybe something wrong when the system rendering the map UI.

This problem seems a long-lasting iOS problem since iOS11 or even earlier. Now, The crash related iOS13 system version includes 13.0, 13.1, 13.1.1, 13.1.2. I have reported the problem on the Apple bug report system, but no any response from Apple until now.

Any advice or hint will be greatly appreciated.

FYI. The crash stack as below.

Exception Type:  SIGABRT
Exception Codes: #0 at 0x1a8530ebc
Crashed Thread:  0

Thread 0 Crashed:
0   libsystem_kernel.dylib              __pthread_kill + 8
1   libsystem_c.dylib                   abort + 100
2   libsystem_c.dylib                   __assert_rtn + 204
3   Metal                               MTLIOAccelCommandBufferStorageGrowSegmentList.cold.1 + 0
4   Metal                               MTLReportFailure + 476
5   Metal                               -[MTLTextureDescriptorInternal validateWithDevice:] + 2124
6   AGXMetalA11                         0x00000001a85f93e8 + 64
7   VectorKit                           ggl::MetalResourceManager::newTexture(ggl::Texture const*) + 596
8   VectorKit                           ggl::MetalRenderer::prepareTexture(ggl::MetalResourceManager*, ggl::Texture const*) + 44
9   VectorKit                           ggl::MetalRenderer::_processQueue(ggl::RenderTarget*, ggl::RenderQueue*, id<MTLCommandBuffer>) + 3220
10  VectorKit                           ggl::MetalRenderer::_processQueue(ggl::RenderTarget*, ggl::RenderQueue*, id<MTLCommandBuffer>) + 96
11  VectorKit                           invocation function for block in ggl::MetalRenderer::frame(ggl::RenderTarget*, ggl::RenderQueue*, std::__1::function<void ()>, std::__1::function<void ()>) + 56
12  VectorKit                           invocation function for block in geo::TaskQueue::sync(std::__1::function<void ()>) + 60
13  libdispatch.dylib                   _dispatch_client_callout + 16
14  libdispatch.dylib                   _dispatch_async_and_wait_invoke_and_complete_recurse + 228
15  libdispatch.dylib                   _dispatch_async_and_wait_f + 100
16  VectorKit                           ggl::MetalRenderer::frame(ggl::RenderTarget*, ggl::RenderQueue*, std::__1::function<void ()>, std::__1::function<void ()>) + 544
17  VectorKit                           ggl::RenderFrame::execute(ggl::RenderTarget*, ggl::RenderQueue*, std::__1::function<void ()>, std::__1::function<void ()>) + 120
18  VectorKit                           -[MDDisplayLayer drawToTexture:withRenderQueue:completionHandler:] + 348
19  VectorKit                           -[MetalLayer _onTimerFired:withPresent:] + 280
20  VectorKit                           md::MapEngine::renderScene(double, std::__1::function<void ()>) + 104
21  VectorKit                           md::MapEngine::onRenderTimerFired(double) + 328
22  VectorKit                           ggl::DisplayLink::onTimerFired(double) + 40
23  VectorKit                           -[_GGLDisplayLinkTarget displayLinkFired:] + 84
24  QuartzCore                          CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 632
25  QuartzCore                          display_timer_callback(__CFMachPort*, void*, long, void*) + 264
26  CoreFoundation                      __CFMachPortPerform + 172
27  CoreFoundation                      __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
28  CoreFoundation                      __CFRunLoopDoSource1 + 444
29  CoreFoundation                      __CFRunLoopRun + 2168
30  CoreFoundation                      CFRunLoopRunSpecific + 464
31  GraphicsServices                    GSEventRunModal + 104
32  UIKitCore                           UIApplicationMain + 1936
33  homebrew                            main (main.m:16)
34  libdyld.dylib                       start + 4

Upvotes: 4

Views: 1936

Answers (1)

Geoffrey Wall
Geoffrey Wall

Reputation: 568

Check your CPU utilization on iOS12 vs iOS13.

I noticed that my app was crashing because I was adding and removing polylines to the map too frequently (although this problem only manifested in iOS13, not iOS12).

See my SO post about this here.

Look at your crash logs and see if you spot something like this:

Event:           cpu usage  
Action taken:    Process killed  
CPU:             48 seconds cpu time over 54 seconds (88% cpu average), exceeding limit of 80% cpu over 60 seconds  
CPU limit:       48s  
Limit duration:  60s  
CPU used:        48s  
Duration:        54.45s  
Steps:           15  

My app stopped crashing in iOS13 if I reduced the frequency for redrawing the map overlays.

Upvotes: 1

Related Questions