iOS 11 crash with VectorKit and Texture2D

Since iOS 11 has been available (11.0 to 11.0.3), we have been getting these crashes. I'm can only assume these crashes are occurring when either the map view or a map tile is being destroyed. However, we cannot reproduce the problem internally. This crash is being reported by Hockey.


Given that this crash is always on thread 0 (i.e., the main thread), we're not sure where to start investigating. It is "normal" for anything UI-related to setup and teardown on the main thread and none of the crashed stack frames contains a reference to code that we wrote.


Has anyone come across

Texture2D
crashes on dealloc?


Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xbadd9a85ba4fbebd
Crashed Thread: 0
Thread 0 Crashed:
0 VectorKit 0x0000000193c6b744 ggl::Texture2D::~Texture2D() + 92
1 libc++.1.dylib 0x0000000183456f64 std::__1::__shared_weak_count::__release_shared() + 68
2 VectorKit 0x0000000193d33bf0 -[VKRasterTile .cxx_destruct] + 168
3 libobjc.A.dylib 0x000000018349eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 144
4 libobjc.A.dylib 0x00000001834ac638 objc_destructInstance + 84
5 libobjc.A.dylib 0x00000001834ac690 object_dispose + 12
6 VectorKit 0x0000000193c3e1e8 -[VKTile dealloc] + 64
7 VectorKit 0x0000000193c49fa4 -[VKRasterTile dealloc] + 72
8 VectorKit 0x0000000193e51f80 __destroy_helper_block_.216 + 36
9 libsystem_blocks.dylib 0x00000001839b1a60 _Block_release + 156
10 libdispatch.dylib 0x0000000183911048 _dispatch_client_callout + 12
11 libdispatch.dylib 0x000000018391db74 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1012
12 CoreFoundation 0x0000000183f33f20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
13 CoreFoundation 0x0000000183f31afc __CFRunLoopRun + 2008
14 CoreFoundation 0x0000000183e522d8 CFRunLoopRunSpecific + 432
15 GraphicsServices 0x0000000185ce3f84 GSEventRunModal + 96
16 UIKit 0x000000018d3ff880 UIApplicationMain + 204
17 <removed app name> 0x0000000104f75438 main (main.m:17)
18 libdyld.dylib 0x000000018397656c start + 0

Replies

I have already 221 crashes in 30 days. It's terrible that can not catch this.

On the prev iOS versions I had some crashes related to VectorKit and same can not investigate.

Do you now VectorKit is open source or can we see the code?

I can catch a crash at the runtime via Xcode but not via instruments.

It happens when opening and close immediately a map view controller with MKOverlay and MKAnnotation.

Stacktrace here:

Thread 1 Queue : com.apple.main-thread (serial)
#0 0x0000000196e1b744 in ggl::Texture2D::~Texture2D() ()
#1 0x0000000186606f64 in std::__1::__shared_weak_count::__release_shared() ()
#2 0x0000000196ee3bf0 in -[VKRasterTile .cxx_destruct] ()
#3 0x000000018664eef4 in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#4 0x000000018665c638 in objc_destructInstance ()
#5 0x000000018665c690 in object_dispose ()
#6 0x0000000196dee1e8 in -[VKTile dealloc] ()
#7 0x0000000196df9fa4 in -[VKRasterTile dealloc] ()
#8 0x0000000197001f80 in __destroy_helper_block_.216 ()
#9 0x0000000186b61a60 in _Block_release ()
#10 0x00000001087d945c in _dispatch_client_callout ()
#11 0x00000001087de050 in _dispatch_main_queue_callback_4CF ()
#12 0x00000001870e3f20 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#13 0x00000001870e1afc in __CFRunLoopRun ()
#14 0x00000001870022d8 in CFRunLoopRunSpecific ()
#15 0x0000000188e93f84 in GSEventRunModal ()
#16 0x00000001905af880 in UIApplicationMain ()
#17 0x00000001007bb8fc in main at .../Application/main.m:37
#18 0x0000000186b2656c in start ()
Enqueued from com.apple.mapdisplay.dispatch.tiledecodequeue (Thread 62) Queue : com.apple.mapdisplay.dispatch.tiledecodequeue (serial)
#0 0x00000001087e8c50 in _dispatch_queue_push ()
#1 0x0000000196de999c in __49-[VKTileSource decodeData:downloadKey:sourceKey:]_block_invoke ()
#2 0x0000000197261370 in std::__1::__function::__func<geo::TaskQueue::async_b(void () block_pointer, geo::TaskGroup const*)::$_0, std::__1::allocator<geo::TaskQueue::async_b(void () block_pointer, geo::TaskGroup const*)::$_0>, void ()>::operator()() ()
#3 0x0000000197260ecc in ___ZN3geo9TaskQueue5asyncENSt3__18functionIFvvEEEPKNS_9TaskGroupE_block_invoke ()
#4 0x00000001087d949c in _dispatch_call_block_and_release ()
#5 0x00000001087d945c in _dispatch_client_callout ()
#6 0x00000001087e6800 in _dispatch_continuation_pop ()
#7 0x00000001087e509c in _dispatch_async_redirect_invoke ()
#8 0x00000001087eab54 in _dispatch_root_queue_drain ()
#9 0x00000001087ea880 in _dispatch_worker_thread3 ()
#10 0x0000000186d67130 in _pthread_wqthread ()
#11 0x0000000186d66c30 in start_wqthread ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0 0x00000001087e89e8 in _dispatch_root_queue_push ()
#1 0x0000000197260e6c in geo::TaskQueue::async(std::__1::function<void ()>, geo::TaskGroup const*) ()
#2 0x0000000197261260 in geo::TaskQueue::async_b(void () block_pointer, geo::TaskGroup const*) ()
#3 0x0000000196de9898 in -[VKTileSource decodeData:downloadKey:sourceKey:] ()
#4 0x0000000196de9d78 in -[VKRasterTileSource decodeData:downloadKey:sourceKey:] ()
#5 0x0000000196de9484 in -[VKTileSource didFetchData:forKey:] ()
#6 0x0000000197002138 in __32-[VKTileSource performDownload:]_block_invoke.168 ()
#7 0x000000018cd1ec88 in __119-[GEOTileLoaderInternal loadKey:additionalInfo:priority:forClient:proxyClient:options:callbackQ:beginNetwork:callback:]_block_invoke ()
#8 0x000000018cd1b50c in ___ZZZ49-[GEOTileLoaderInternal _loadedTile:forKey:info:]EUb_ENK3$_5clERKN8LoadItem9RequesterE_block_invoke ()
#9 0x00000001087eb5cc in _dispatch_block_async_invoke2 ()
#10 0x00000001087d945c in _dispatch_client_callout ()
#11 0x00000001087de050 in _dispatch_main_queue_callback_4CF ()
#12 0x00000001870e3f20 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#13 0x00000001870e1afc in __CFRunLoopRun ()
#14 0x00000001870022d8 in CFRunLoopRunSpecific ()
#15 0x0000000188e93f84 in GSEventRunModal ()
#16 0x00000001905af880 in UIApplicationMain ()
#17 0x00000001007bb8fc in main at .../Application/main.m:37
#18 0x0000000186b2656c in start ()
Enqueued from com.apple.geo.tile-loader.0x10fde2370.isolation (Thread 56) Queue : com.apple.geo.tile-loader.0x10fde2370.isolation (serial)
#0 0x00000001087e8c50 in _dispatch_queue_push ()
#1 0x000000018cd17ee4 in LoadItem::Requester::performAsyncOnCallbackQueue(void () block_pointer) const ()
#2 0x000000018cd1b3f4 in _ZNSt3__110__function6__funcIZZ49-[GEOTileLoaderInternal _loadedTile:forKey:info:]EUb_E3$_5NS_9allocatorIS2_EEFvRN8LoadItem9RequesterEEEclES7_ ()
#3 0x000000018cbe490c in __49-[GEOTileLoaderInternal _loadedTile:forKey:info:]_block_invoke ()
#4 0x000000018cd161ac in -[GEOTileLoaderInternal _loadedTileForLocalKey:preliminary:quickly:tileDecoder:data:disburseTile:] ()
#5 0x000000018cd1acb4 in __49-[GEOTileLoaderInternal _loadedTile:forKey:info:]_block_invoke.472 ()
#6 0x00000001087d945c in _dispatch_client_callout ()
#7 0x00000001087e6d50 in _dispatch_queue_barrier_sync_invoke_and_complete ()
#8 0x000000018cbe429c in -[GEOTileLoaderInternal _loadedTile:forKey:info:] ()
#9 0x000000018cbe3e24 in -[GEOTileLoaderInternal proxy:loadedTile:forKey:info:] ()
#10 0x000000018cbe3d98 in __40-[GEOTileServerRemoteProxy _handleTile:]_block_invoke ()
#11 0x00000001087d949c in _dispatch_call_block_and_release ()
#12 0x00000001087d945c in _dispatch_client_callout ()
#13 0x00000001087e8110 in _dispatch_queue_serial_drain ()
#14 0x00000001087dc9a4 in _dispatch_queue_invoke ()
#15 0x00000001087e7f30 in _dispatch_queue_serial_drain ()
#16 0x00000001087dc9a4 in _dispatch_queue_invoke ()
#17 0x00000001087e9104 in _dispatch_root_queue_drain_deferred_wlh ()
#18 0x00000001087f0100 in _dispatch_workloop_worker_thread ()
#19 0x0000000186d66fe0 in _pthread_wqthread ()
#20 0x0000000186d66c30 in start_wqthread ()
Enqueued from com.apple.geo.TileServerRemoteProxy.connection.reply (Thread 44) Queue : com.apple.geo.TileServerRemoteProxy.connection.reply (serial)
#0 0x00000001087e8c50 in _dispatch_queue_push ()
#1 0x000000018cbe36ec in -[GEOTileServerRemoteProxy _handleTile:] ()
#2 0x000000018cebcb18 in -[GEOTileServerRemoteProxy _handleEvent:] ()
#3 0x000000018cebe7f4 in __32-[GEOTileServerRemoteProxy open]_block_invoke_2 ()
#4 0x000000018cec0874 in __75+[GEOXPCUtil createServerConnectionWithQueue:debugIdentifier:eventHandler:]_block_invoke ()
#5 0x0000000186da2300 in _xpc_connection_call_event_handler ()
#6 0x0000000186d9fcb0 in _xpc_connection_mach_event ()
#7 0x00000001087d952c in _dispatch_client_callout4 ()
#8 0x00000001087dcf58 in _dispatch_mach_msg_invoke ()
#9 0x00000001087e7f30 in _dispatch_queue_serial_drain ()
#10 0x00000001087dc4c0 in _dispatch_mach_invoke ()
#11 0x00000001087e7f30 in _dispatch_queue_serial_drain ()
#12 0x00000001087dc9a4 in _dispatch_queue_invoke ()
#13 0x00000001087e9104 in _dispatch_root_queue_drain_deferred_wlh ()
#14 0x00000001087f0100 in _dispatch_workloop_worker_thread ()
#15 0x0000000186d66fe0 in _pthread_wqthread ()
#16 0x0000000186d66c30 in start_wqthread ()


Console:


2017-11-08 13:04:41.066030-0800 CGPProd[3983:1376092] [VKDefault] Tile 34322.50234.17 (128) in current unloaded state for 0.03 seconds - Raster Overlays Above Labels - Failed to decode (terminal) (0.03 sec)

2017-11-08 13:04:41.066288-0800 CGPProd[3983:1376092] [VKDefault] Tile 34323.50234.17 (128) in current unloaded state for 0.02 seconds - Raster Overlays Above Labels - Failed to decode (terminal) (0.02 sec)

2017-11-08 13:04:41.066404-0800 CGPProd[3983:1376092] [VKDefault] Tile 34320.50234.17 (128) in current unloaded state for 0.02 seconds - Raster Overlays Above Labels - Failed to decode (terminal) (0.02 sec)

2017-11-08 13:04:41.066513-0800 CGPProd[3983:1376092] [VKDefault] Tile 34321.50234.17 (128) in current unloaded state for 0.02 seconds - Raster Overlays Above Labels - Failed to decode (terminal) (0.02 sec)

2017-11-08 13:04:41.091039-0800 CGPProd[3983:1376092] [VKDefault] Tile 34318.50234.17 (128) in current unloaded state for 0.02 seconds - Raster Overlays Above Labels - Failed to decode (terminal) (0.02 sec)

2017-11-08 13:04:41.151170-0800 CGPProd[3983:1376092] [VKDefault] Tile 34319.50234.17 (128) in current unloaded state for 0.02 seconds - Raster Overlays Above Labels - Failed to decode (terminal) (0.02 sec)

I can not reproduce this bug on iOS 11.1v but the console shows 'Raster Overlays Above Labels' fail message.

The Crashlytics reported only one bug on 11.1 and I think that we can wait when Apple will fix it.

From the last post, we have a lot of reports for 11.1 version and it's growing.

We’re intentionally not encouraging our users to upgrade to iOS 11 and

cannot update the minimum version of our app to use iOS 10 because of this issue.

We will be very appreciate in Apple help.

We are facing the same problem. Can anyone get Apple support ? 😟

I am facing the same problem too...

Similar crash happens on our app for about 4 months, and report to apple, no response until now.

I know it's a long shot, but did you ever get an update on this?

iOS 11.3 has been released and we are seeing a lot of occurrences of this in our app. Seeing as we can't reproduce this in house, any fix we implement is just a shot in the dark at this point.

The radar is here and the bug report was closed by apple.

Still getting this crash

We continue to see crashes in the VectorKit code. The reports show that iOS 12 and 13 still have this issue. Reported to Apple again.

I'm having the same problem in IOS 11 & 12. Is there any way to solve this crash. I have tried various solutions but could not able to fix this bug. I cannot reproduce it either, but users keep getting this crash in our live app.


Still crashes on iOS 13.4.1

md::GeoResourceProvider::resourceNames(std::_1::bitset<2ul>)

VectorKit
md::GeoResourceProvider::resourceNames(std::
1::bitset<2ul>)
VectorKit
grl::ResourceProvider::resourceNamesOfResourceAndPackType(grl::ResourceType, grl::codec::PackType, std::
1::bitset<2ul>)
VectorKit
grl::IconManager::loadGlobalResourcePack(std::1::pair<std::1::basic
string<char, std::1::chartraits<char>, std::1::allocator<char> >, float> const&, grl::codec::PackType)
VectorKit
grl::IconManager::identifierForName(std::1::basic
string<char, std::1::chartraits<char>, std::1::allocator<char> > const&, float, grl::IconManager::Fallback)
VectorKit
grl::IconManager::imageForName(std::1::basic
string<char, std::1::chartraits<char>, std::1::allocator<char> > const&, float, grl::SizeGroup, unsigned int, unsigned int, grl::IconModifiers const&, std::1::vector<std::1::basicstring<char, std::1::chartraits<char>, std::1::allocator<char> >, std::1::allocator<std::1::basicstring<char, std::1::chartraits<char>, std::1::allocator<char> > > > const&)
VectorKit
md::LabelImageLoader::loadImage(std::
1::sharedptr<md::LabelImageKey> const&, bool)
VectorKit
md::LabelStyle::namedIcon(md::LabelManager*, md::Label*, std::1::basicstring<char, std::1::chartraits<char>, geo::StdAllocator<char, mdm::Allocator> > const&, bool)
VectorKit
md::LabelStyle::arrowIcon(md::LabelManager*, md::Label*, md::RoadLabelFeature*)
VectorKit
md::RoadLabelFeature::newRootPart(md::LabelManager*, md::Label*, md::LabelStyle*, md::LabelPartCreationOptions&)
VectorKit
md::Label::createNextPart(md::LabelManager*, md::LabelPartCreationOptionsOverrides const*)
VectorKit
md::Label::layoutForStaging(md::LabelManager*, md::LabelPool*)
VectorKit
md::StandardLabeler::layoutLabelsForStaging()
VectorKit
md::StandardLabeler::layoutForStaging(md::LabelUpdateOptions const&)
VectorKit
md::CompositeLabeler::layoutForStaging(md::LabelUpdateOptions const&)
VectorKit
md::LabelManager::layoutForStaging(md::LabelUpdateOptions const&)
VectorKit
std::1::function::func<md::LabelManager::evaluateUpdateOperation(bool&, bool&)::$4, std::1::allocator<md::LabelManager::evaluateUpdateOperation(bool&, bool&)::$4>, void ()>::operator()()
VectorKit
ZN3geo9TaskQueue14queueAsyncTaskENSt3110sharedptrINS4TaskEEEPU28objcproto17OSdispatchgroup8NSObjectblockinvoke
libdispatch.dylib
dispatchcallblockandrelease
libdispatch.dylib
dispatchclientcallout
libdispatch.dylib
dispatchlaneserialdrain$VARIANT$mp
libdispatch.dylib
dispatchlaneinvoke$VARIANT$mp
libdispatch.dylib
dispatchworkloopworkerthread
libsystempthread.dylib
pthreadwqthread
libsystem
pthread.dylib
start_wqthread
main.swift, line 10

MAIN THREAD - CRASHED
libsystemkernel.dylib
abortwithpayload
libsystem
kernel.dylib
abortwithreason
VectorKit
ggl::MetalResourceManager::newBuffer(ggl::Buffer const*)
VectorKit
ggl::MetalResourceManager::upload(ggl::BufferLoadItem const&)
VectorKit
ggl::MetalRenderer::processBuffer(ggl::RenderTarget*, ggl::CommandBuffer*, ggl::PassDescriptor const&, id<MTLCommandBuffer>, std::1::sharedptr<ggl::RenderTransaction> const&)
VectorKit
ggl::MetalRenderer::processQueue(ggl::RenderTarget*, ggl::RenderQueue*, id<MTLCommandBuffer>)
VectorKit
ggl::MetalRenderer::
processQueue(ggl::RenderTarget*, ggl::RenderQueue*, id<MTLCommandBuffer>)
VectorKit
ZN3ggl13MetalRenderer5frameEPNS12RenderTargetEPNS11RenderQueueENSt318functionIFvvEEES8blockinvoke
VectorKit
ZN3geo9TaskQueue4syncENSt318functionIFvvEEEblockinvoke
libdispatch.dylib
dispatchclientcallout
libdispatch.dylib
dispatchasyncandwaitinvokeandcompleterecurse
libdispatch.dylib
dispatchasyncandwaitf
VectorKit
ggl::MetalRenderer::frame(ggl::RenderTarget*, ggl::RenderQueue*, std::1::function<void ()>, std::1::function<void ()>)
VectorKit
ggl::RenderFrame::execute(ggl::RenderTarget*, ggl::RenderQueue*, std::1::function<void ()>, std::1::function<void ()>)
VectorKit
  • [MDDisplayLayer drawToTexture:withRenderQueue:completionHandler:]

VectorKit
  • [MetalLayer 

onTimerFired:withPresent:]VectorKit
md::MapEngine::renderScene(double, std::_1::function<void ()>)
VectorKit
md::MapEngine::onRenderTimerFired(double)
VectorKit
ggl::DisplayLink::onTimerFired(double)
VectorKit
  • [

GGLDisplayLinkTarget displayLinkFired:]QuartzCore
CA::Display::DisplayLink::dispatchitems(unsigned long long, unsigned long long, unsigned long long)
IOKit
IODispatchCalloutFromCFMessage
CoreFoundation
CFMachPortPerform
CoreFoundation
CFRUNLOOP
ISCALLINGOUTTOASOURCE1PERFORMFUNCTION
CoreFoundation
CFRunLoopDoSource1
CoreFoundation
_CFRunLoopRun
CoreFoundation
CFRunLoopRunSpecific
GraphicsServices
GSEventRunModal
UIKitCore
UIApplicationMain
Althea
main main.swift:10
libdyld.dylib
start