MKTileOverlayRequester with Fatal Exception: NSRangeException

Hello Apple Devs,

I have more then 34 crashes on iOS 11 on iPad and iPhone devices. It's not reproduceble on the prev versions.

This crash related to the MapKit library when presenting my custom tiles.

I have a code with MKTileOverlay class and overrided func "loadTile(at path: MKTileOverlayPath, result: @escaping (Data?, Error?) -> Void)" which returning a tile in an async request from the server. I don't process any arrays and don't know how this crash can happen. It looks like the same issue that the MapKit has with rendering in iOS 11.

Please help with any advice.


Fatal Exception: NSRangeException
0  CoreFoundation                 0x187403d38 __exceptionPreprocess
1  libobjc.A.dylib                0x186918528 objc_exception_throw
2  CoreFoundation                 0x18739cc44 _CFArgv
3  CoreFoundation                 0x18738a9b0 -[__NSArrayM removeObjectsInRange:]
4  MapKit                         0x1978c9ac8 -[MKTileOverlayRequester _doWorkOrFinish]
5  MapKit                         0x1978ca0e8 -[MKTileOverlayRequester _operationFailed:error:]
6  MapKit                         0x1978cac84 __33-[MKTileOverlayRequesterOp start]_block_invoke_3
7  libdispatch.dylib              0x186d89088 _dispatch_call_block_and_release
8  libdispatch.dylib              0x186d89048 _dispatch_client_callout
9  libdispatch.dylib              0x186d92e48 _dispatch_queue_serial_drain$VARIANT$mp
10 libdispatch.dylib              0x186d937d8 _dispatch_queue_invoke$VARIANT$mp
11 libdispatch.dylib              0x186d94200 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp
12 libdispatch.dylib              0x186d9c4a0 _dispatch_workloop_worker_thread$VARIANT$mp
13 libsystem_pthread.dylib        0x18702efe0 _pthread_wqthread
14 libsystem_pthread.dylib        0x18702ec30 start_wqthread

Replies

We are having the same problems with our code and other issues related to that, such as tiles that render several tiles for no reasons, illegal access crashes in similar MapKit code after a call to result() and it makes our app unstable, which is unfortunate because we're about to release it officially after 2 years of work and this delays our product launch. We never had those kind of problems before ios11, other than the occasional out of memory errors that were caused by leaks. It really is annoying and two days of scouting the code for errors brought no solution.

We have the same problem with costmized MKTileOverlayRenderer on ios11

the crash log trace

Exception Type: EXC_CRASH (SIGABRT)

Exception Codes: 0x0000000000000000, 0x0000000000000000

Exception Note: EXC_CORPSE_NOTIFY

Triggered by Thread: 0



Application Specific Information:

abort() called



Filtered syslog:

None found



Last Exception Backtrace:

0 CoreFoundation 0x18437f164 __exceptionPreprocess + 124

1 libobjc.A.dylib 0x1835c8528 objc_exception_throw + 55

2 CoreFoundation 0x184317c9c _CFThrowFormattedException + 111

3 CoreFoundation 0x18430599c -[__NSArrayM removeObjectsInRange:] + 2655

4 MapKit 0x1949e8c3c -[MKTileOverlayRequester _doWorkOrFinish] + 179

5 MapKit 0x1949e9550 -[MKTileOverlayRequester start] + 699

6 GeoServices 0x18a043c58 __98-[GEOTileServerLocalProxy loadTiles:priorities:hasAdditionalInfos:additionalInfos:options:client:]_block_invoke.138 + 1115

7 GeoServices 0x18a041a78 -[GEOTileServerLocalProxy loadTiles:priorities:hasAdditionalInfos:additionalInfos:options:client:] + 2347

8 libdispatch.dylib 0x183cfea14 _dispatch_client_callout + 15

9 libdispatch.dylib 0x183d06200 _dispatch_block_invoke_direct$VARIANT$mp + 287

10 GeoServices 0x189ecfec0 -[GEOTileLoaderInternal _requestOnlineTiles] + 2095

11 libdispatch.dylib 0x183cfea14 _dispatch_client_callout + 15

12 libdispatch.dylib 0x183d07618 _dispatch_queue_barrier_sync_invoke_and_complete + 55

13 GeoServices 0x189ecf678 -[GEOTileLoaderInternal _timerFired] + 95

14 libdispatch.dylib 0x183d0c6a8 _dispatch_block_async_invoke2 + 115

15 libdispatch.dylib 0x183cfea14 _dispatch_client_callout + 15

16 libdispatch.dylib 0x183d06f08 _dispatch_continuation_pop$VARIANT$mp + 427

17 libdispatch.dylib 0x183d10848 _dispatch_source_invoke$VARIANT$mp + 1587

18 libdispatch.dylib 0x183d08824 _dispatch_queue_serial_drain$VARIANT$mp + 199

19 libdispatch.dylib 0x183d092fc _dispatch_queue_invoke$VARIANT$mp + 339

20 libdispatch.dylib 0x183d09d20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 403

21 libdispatch.dylib 0x183d1203c _dispatch_workloop_worker_thread$VARIANT$mp + 643

22 libsystem_pthread.dylib 0x183fa6f1c _pthread_wqthread + 931

23 libsystem_pthread.dylib 0x183fa6b6c start_wqthread + 3

Hi here!


Same with various devices on iOS 11 but also iOS 12. The GEOTileServerLocalProxy.workQueue thread randomly crash.


I've also a very simple custom object of MKTileOverlay with customization of loadTileAtPath.


Basically like you guys.