CFNetwork Crash iOS 11

Hi,


We are facing huge number of crashes ~14k in the last month with the number of crashes increasing with the release of 11.2.1 (95% of crashes coming from 11.2.1 in the last 7 days)


Please find the link ot the crash report. https://drive.google.com/open?id=1clHo2caN0CPKtc_hyRy92JiGdjKU6Tux

We are not able to reproduce this issue and the logs do not reveal much.


0   CFNetwork                  
0x0000000184207cb8 resolveTubeTypeForKey(HTTPConnectionCacheKey*, CoreLoggable*, TubeType*, __CFArray const**) + 32 (Tube.cpp:1866)
1   CFNetwork                  
0x00000001841d5090 TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 112 (TubeManager.cpp:856)
2   CFNetwork                  
0x00000001841d5090 TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 112 (TubeManager.cpp:856)
3   CFNetwork                  
0x00000001841d5fd8 TubeManager::_onqueue_reenqueueAwaitingTube(BaseAwaitingTube*) + 112 (TubeManager.cpp:428)
4   CFNetwork                  
0x00000001841d6238 invocation function for block in TubeManager::_onqueue_newTubeReady(Tube*, CFStreamError) + 28 (TubeManager.cpp:681)
5   CFNetwork                  
0x0000000184334904 invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const + 52 (CoreSchedulingSet.mm:189)
6   libdispatch.dylib          
0x00000001834faa54 _dispatch_call_block_and_release + 24 (init.c:994)
7   libdispatch.dylib          
0x00000001834faa14 _dispatch_client_callout + 16 (object.m:502)
8   libdispatch.dylib          
0x000000018353904c _dispatch_queue_serial_drain$VARIANT$armv81 + 520 (inline_internal.h:2500)
9   libdispatch.dylib          
0x00000001835399bc _dispatch_queue_invoke$VARIANT$armv81 + 340 (queue.c:5302)
10  libdispatch.dylib          
0x0000000183538f0c _dispatch_queue_serial_drain$VARIANT$armv81 + 200 (inline_internal.h:2539)
11  libdispatch.dylib          
0x00000001835399bc _dispatch_queue_invoke$VARIANT$armv81 + 340 (queue.c:5302)
12  libdispatch.dylib          
0x000000018353a3a8 _dispatch_root_queue_drain_deferred_wlh$VARIANT$armv81 + 384 (queue.c:5920)
13  libdispatch.dylib          
0x00000001835424b0 _dispatch_workloop_worker_thread$VARIANT$armv81 + 640 (source.c:2529)
14  libsystem_pthread.dylib    
0x00000001837a2f1c _pthread_wqthread + 932 (pthread.c:2207)
15  libsystem_pthread.dylib    
0x00000001837a2b6c start_wqthread + 4



Can someone point us to the right direction on this?. Thank you.

There’s a bunch of different issues related

TubeManager
, on internal C++ class within the CFNetwork framework. You can read more about this on this thread. In your case I believe you’re hitting one of the ones we already now about (r. 27636468).

You should feel free to file your own bug about this, attaching a selection of your crash reports. It’s likely this will be dup’d to the bug I mentioned above, but it’d be good to have your experience on file.

Also, if you can find any way to reproduce the problem, or even just increase the likelihood of it reproducing, that’d be extremely valuable.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi eskimo,

Thanks for the reponse. I have already filed a bug report for this. As mentioned this is something that we are not able to reproduce.

Is it possible to clarify a little more on this

1. Is this happening only when the app is in background?. We want to know how it affects our users.

2. Since its already being tracked, is there a work around for now or a guesstimate on when this might be resolved?.


I have already filed a bug report for this.

What was your bug number?

1. Is this happening only when the app is in background?

I’m not aware of this being related to background execution.

2. Since its already being tracked, is there a work around for now

I investigate these issues in depth as part of various DTS incidents and I’ve been unable to find any workaround.

or a guesstimate on when this might be resolved?

Sorry, no. My management gets grumpy if I start speculating about the future.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks again for addressing those questions.


The bug number is 36333906

We are also exepriencing same crashes. My investigation makes me think, that the crash is happening in the background when the app is launched from suspended mode with Background Fetch.


For some reason our crash doesn't appear in Xcode, but i have one from Fabric:

https://gist.github.com/jarosan/25af589fea381a59f2c64f049ab69e7a

Since we are experiencing similar crashes, but out user base is much smaller (app still in beta testing), I was wondering if crashes are occurring uniquely per user for you as well? We are observing that crash only occurs one time for each user and it always happens shortly after user upgrades his iOS (for example from 11.2.2 to 11.2.5).

> Since we are experiencing similar crashes, but out user base is much smaller (app still in beta testing), I was wondering if crashes are occurring uniquely per user for you as well?


We are noticing this is "roughly" true. We have seen multiple crashes for the same users, but not very many.

Same thing for our application. Very high number of crashes in resolveTubeTypeForKey.

It was happening on iOS 10 but at a much lower pace.


Here is a graph from Crashlytics for that specific crash the last 90 days:

https://drive.google.com/file/d/1OICJwdEUSkPD6kU8EQtTrRNKTjkPt4ri/view?usp=sharing


Total of 148k crashes that happened for 97k users, so it may happen more that once per user. Or maybe it's 1 per user and per version of the application, like if it's crashing the first time the app is run after an update...


When I look at the individual crash sessions, it's always crashing before the app reaches the active state (before applicationDidBecomeActive: is called).

The background fetch and location update are enabled for our application.

The same crash is happening with our application. Crash info from Fabric: https://gist.github.com/ashokkumarmw/7d886bdcea169d3bf5d0efc5fd64e23a

Hi Eskimo, is there any updates/workarounds on this crash? (and some of the seemingly related ones with the tube manager). I'm still seeing this crash a decent amount. If you would like me to file a bug report I can do that.

Seems like this crash was fixed in iOS 11.3

The crash is still happening for me according to Crashlytics. Since iOS 11.4.1 is the latest currently - 80% happening on it.

There are also crashes on iOS 10, so this issue is not unique for iOS 11.

CFNetwork Crash iOS 11
 
 
Q