Crashed: com.apple.CFNetwork.Connection

We are experiencing a number of crashes in com.apple.CFNetwork.Connection. The stack trace is very small and does not indicate much, so any help would be very appreciated.


Here is the entire stack trace


Crashed: com.apple.CFNetwork.Connection

0 CoreFoundation 0x183d176a4 CFDictionaryGetValue + 100

1 CFNetwork 0x1844dbc40 Tube::_onqueue_prepAllowedProtocols() + 264

2 CFNetwork 0x1844dba08 invocation function for block in Tube::_onqueue_connect() + 40

3 CFNetwork 0x1844db110 Tube::_onqueue_connect() + 180

4 CFNetwork 0x1844db044 invocation function for block in Tube::initialize(BaseAwaitingTube*) + 44

5 libdispatch.dylib 0x1837dd088 _dispatch_call_block_and_release + 24

6 libdispatch.dylib 0x1837dd048 _dispatch_client_callout + 16

7 libdispatch.dylib 0x1837e6e48 _dispatch_queue_serial_drain$VARIANT$mp + 528

8 libdispatch.dylib 0x1837e77d8 _dispatch_queue_invoke$VARIANT$mp + 340

9 libdispatch.dylib 0x1837e6d00 _dispatch_queue_serial_drain$VARIANT$mp + 200

10 libdispatch.dylib 0x1837e77d8 _dispatch_queue_invoke$VARIANT$mp + 340

11 libdispatch.dylib 0x1837e8200 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 400

12 libdispatch.dylib 0x1837f04a0 _dispatch_workloop_worker_thread$VARIANT$mp + 644

13 libsystem_pthread.dylib 0x183a82fe0 _pthread_wqthread + 932

14 libsystem_pthread.dylib 0x183a82c30 start_wqthread + 4

Replies

Wow, I just looked at this on behalf of some other developer. It wasn’t something that I’d seen before but it is something that Apple is tracking (r. 32605245). Some poking around in the disassembler reveals that it’s crashing in

CFDictionaryGetValue
because the dictionary passed in to that routine is nil. That dictionary is derived from a data member of the
Tube
class (see frames 1 through 4). This is a C++ class that’s internal to CFNetwork. The fact that it is calling
CFDictionary
with nil implies that this crash is very much like the other tube-related crashes we’ve seen (like this thread and this thread), that is, an internal state handling bug in the CFNetwork framework.

If you have a way to reproduce the crash that’d be super helpful.

Share and Enjoy

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

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

Thank you for getting back to me.


Unfortunately when testing internally we never hit these crashes, but once we release into the wild they have been piling up non-stop.


I wish I could be more help.

This is interesting. I am seeing a very similar issue. Whilst it existed in very limited numbers pre iOS 11.2, it seems to have grown in proportion to the user take up of 11.2 / 11.2.1.

I cannot recreate this issue, but it occurs in the wild.


Here is a stack trace:

0   CFNetwork                  
0x000000018447c934 CFAllocatedReferenceCountedObject::_retainable_hash(void const*) + 0 (CFObject.cpp:204)
1   CoreFoundation              
0x0000000183d15360 CFBasicHashFindBucket + 164 (CFBasicHash.c:455)
2   CoreFoundation              
0x0000000183d152a0 CFDictionaryGetValue + 224 (CFDictionary.c:418)
3   CFNetwork                  
0x00000001844ad070 TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 80 (CFObject.h:712)
4   CFNetwork                  
0x00000001844adfd8 TubeManager::_onqueue_reenqueueAwaitingTube(BaseAwaitingTube*) + 112 (TubeManager.cpp:428)
5   CFNetwork                  
0x00000001844ae238 invocation function for block in TubeManager::_onqueue_newTubeReady(Tube*, CFStreamError) + 28 (TubeManager.cpp:681)
6   CFNetwork                  
0x000000018460c904 invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const + 52 (CoreSchedulingSet.mm:189)
7   libdispatch.dylib          
0x00000001837d2a54 _dispatch_call_block_and_release + 24 (init.c:994)
8   libdispatch.dylib          
0x00000001837d2a14 _dispatch_client_callout + 16 (object.m:502)
9   libdispatch.dylib          
0x00000001837dc96c _dispatch_queue_serial_drain$VARIANT$mp + 528 (inline_internal.h:2500)
10  libdispatch.dylib          
0x00000001837dd2fc _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)
11  libdispatch.dylib          
0x00000001837dc824 _dispatch_queue_serial_drain$VARIANT$mp + 200 (inline_internal.h:2539)
12  libdispatch.dylib          
0x00000001837dd2fc _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)
13  libdispatch.dylib          
0x00000001837ddd20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 404 (queue.c:5920)
14  libdispatch.dylib          
0x00000001837e603c _dispatch_workloop_worker_thread$VARIANT$mp + 644 (source.c:2529)
15  libsystem_pthread.dylib    
0x0000000183a7af1c _pthread_wqthread + 932 (pthread.c:2207)
16  libsystem_pthread.dylib    
0x0000000183a7ab6c start_wqthread + 4


Any idea what is happening?

This is not the same crash as reported by mikeKane. There are, however, a bunch of similar crashes discussed in this thread. If you post a full crash log I should be able to tell you whether it matches up with anything we know about already.

Share and Enjoy

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

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

Hi,

We have huge spike on crashes because of this tubemanager crash. Do we have fixes for this?



Exception Type: EXC_BAD_ACCESS (SIGSEGV)

Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Region Info: 0 is not in any region. Bytes before following region: 4312285184

REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL

UNUSED SPACE AT START

--->

__TEXT 0000000101084000-0000000101088000 [ 16K] r-x/r-x SM=COW ...Afee Security

Termination Signal: Segmentation fault: 11

Termination Reason: Namespace SIGNAL, Code 0xb

Terminating Process: exc handler [0]

Triggered by Thread: 6


Thread 6 name:

Thread 6 Crashed:

0 CFNetwork 0x0000000182d34934 CFAllocatedReferenceCountedObject::_retainable_hash(void const*) + 0 (CFObject.cpp:204)

1 CoreFoundation 0x00000001825cd360 CFBasicHashFindBucket + 164 (CFBasicHash.c:455)

2 CoreFoundation 0x00000001825cd2a0 CFDictionaryGetValue + 224 (CFDictionary.c:418)

3 CFNetwork 0x0000000182d65070 TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 80 (CFObject.h:712)

4 CFNetwork 0x0000000182d65fd8 TubeManager::_onqueue_reenqueueAwaitingTube(BaseAwaitingTube*) + 112 (TubeManager.cpp:428)

5 CFNetwork 0x0000000182d66238 invocation function for block in TubeManager::_onqueue_newTubeReady(Tube*, CFStreamError) + 28 (TubeManager.cpp:681)

6 CFNetwork 0x0000000182ec4904 invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const + 52 (CoreSchedulingSet.mm:189)

7 libdispatch.dylib 0x000000018208aa54 _dispatch_call_block_and_release + 24 (init.c:994)

8 libdispatch.dylib 0x000000018208aa14 _dispatch_client_callout + 16 (object.m:502)

9 libdispatch.dylib 0x000000018209496c _dispatch_queue_serial_drain$VARIANT$mp + 528 (inline_internal.h:2500)

10 libdispatch.dylib 0x00000001820952fc _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)

11 libdispatch.dylib 0x0000000182094824 _dispatch_queue_serial_drain$VARIANT$mp + 200 (inline_internal.h:2539)

12 libdispatch.dylib 0x00000001820952fc _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)

13 libdispatch.dylib 0x0000000182095d20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 404 (queue.c:5920)

14 libdispatch.dylib 0x000000018209e03c _dispatch_workloop_worker_thread$VARIANT$mp + 644 (source.c:2529)

15 libsystem_pthread.dylib 0x0000000182332f1c _pthread_wqthread + 932 (pthread.c:2207)

16 libsystem_pthread.dylib 0x0000000182332b6c start_wqthread + 4

Do we have fixes for this?

It’s hard to say anything concrete without seeing at a full crash report.

Share and Enjoy

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

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

Hi,


You can download the full crash log here.


https://drive.google.com/file/d/1ECwoha83QjFptEHQ2Zj6YRl5e-aHeKO1/view?usp=sharing

You can download the full crash log here.

Ta!

I posted a response on the thread that you originally opened about this crash.

Share and Enjoy

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

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

We're also experiencing exaclty the same crashes in com.apple.CFNetwork.Connection as @mikeKane.


You can find the stack trace here: http://crashes.to/s/f28df52f227


Is there any solution for this?

Yeah, I'm also wondering if there is any updates to the crash log I have posted. They are still occuring very rapidly.


Thanks!

I'm also wondering if there is any updates to the crash log I have posted. They are still occuring very rapidly.

Hello guys !


Any solution with this problem ?
I have the exactly same problem : my top crash issue in Fabric is


Crashed: com.apple.CFNetwork.Connection

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000


Crashed: com.apple.CFNetwork.Connection

0 CoreFoundation 0x184052024 CFDictionaryGetValue + 100

1 CFNetwork 0x184819414 Tube::_onqueue_prepAllowedProtocols() + 264

2 CFNetwork 0x1848191dc invocation function for block in Tube::_onqueue_connect() + 40

3 CFNetwork 0x1848188e4 Tube::_onqueue_connect() + 180

4 CFNetwork 0x184818818 invocation function for block in Tube::initialize(BaseAwaitingTube*) + 44

5 libdispatch.dylib 0x183b12a54 _dispatch_call_block_and_release + 24

6 libdispatch.dylib 0x183b12a14 _dispatch_client_callout + 16

7 libdispatch.dylib 0x183b1c96c _dispatch_queue_serial_drain$VARIANT$mp + 528

8 libdispatch.dylib 0x183b1d2fc _dispatch_queue_invoke$VARIANT$mp + 340

9 libdispatch.dylib 0x183b1c824 _dispatch_queue_serial_drain$VARIANT$mp + 200

10 libdispatch.dylib 0x183b1d2fc _dispatch_queue_invoke$VARIANT$mp + 340

11 libdispatch.dylib 0x183b1dd20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 404

12 libdispatch.dylib 0x183b2603c _dispatch_workloop_worker_thread$VARIANT$mp + 644

13 libsystem_pthread.dylib 0x183dbaf1c _pthread_wqthread + 932

14 libsystem_pthread.dylib 0x183dbab6c start_wqthread + 4


Do you have any clue ?

How can we fix this ?


Thank you very much !

Same thing happening with me


# Date: 2018-05-05T14:28:00Z

# OS Version: 11.2.5 (15D60)

# Device: iPhone 6

# RAM Free: 4.9%

# Disk Free: 42.6%

#12. Crashed: com.apple.CFNetwork.LoaderQ
0  CFNetwork                      0x184b2d310 CFAllocatedReferenceCountedObject::_retainable_hash(void const*) + 26
1  CoreFoundation                 0x1843c6160 CFBasicHashFindBucket + 164
2  CoreFoundation                 0x1843c60a0 CFDictionaryGetValue + 224
3  CFNetwork                      0x184b5da4c TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 80
4  CFNetwork                      0x184b5e9b4 TubeManager::_onqueue_reenqueueAwaitingTube(BaseAwaitingTube*) + 112
5  CFNetwork                      0x184b5ec14 invocation function for block in TubeManager::_onqueue_newTubeReady(Tube*, CFStreamError) + 28
6  CFNetwork                      0x184cbd2e4 invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const + 52
7  libdispatch.dylib              0x183e86a54 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x183e86a14 _dispatch_client_callout + 16
9  libdispatch.dylib              0x183e9096c _dispatch_queue_serial_drain$VARIANT$mp + 528
10 libdispatch.dylib              0x183e912fc _dispatch_queue_invoke$VARIANT$mp + 340
11 libdispatch.dylib              0x183e90824 _dispatch_queue_serial_drain$VARIANT$mp + 200
12 libdispatch.dylib              0x183e912fc _dispatch_queue_invoke$VARIANT$mp + 340
13 libdispatch.dylib              0x183e91d20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 404
14 libdispatch.dylib              0x183e9a03c _dispatch_workloop_worker_thread$VARIANT$mp + 644
15 libsystem_pthread.dylib        0x18412ef1c _pthread_wqthread + 932
16 libsystem_pthread.dylib        0x18412eb6c start_wqthread + 4


# Date: 2018-05-04T19:49:00Z

# OS Version: 11.2.2 (15C202)

# Device: iPhone 6

# RAM Free: 4.8%

# Disk Free: 51.6%



#9. Crashed: com.apple.CFNetwork.LoaderQ
0  CFNetwork                      0x184d88934 CFAllocatedReferenceCountedObject::_retainable_hash(void const*) + 26
1  CoreFoundation                 0x184621360 CFBasicHashFindBucket + 164
2  CoreFoundation                 0x1846212a0 CFDictionaryGetValue + 224
3  CFNetwork                      0x184db9070 TubeManager::_onqueue_enqueueRequestForProtocol(MetaConnectionCacheClient*, HTTPRequestMessage const*, MetaConnectionOptions, BaseAwaitingTube*) + 80
4  CFNetwork                      0x184db9fd8 TubeManager::_onqueue_reenqueueAwaitingTube(BaseAwaitingTube*) + 112
5  CFNetwork                      0x184dba238 invocation function for block in TubeManager::_onqueue_newTubeReady(Tube*, CFStreamError) + 28
6  CFNetwork                      0x184f18904 invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const + 52
7  libdispatch.dylib              0x1840dea54 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x1840dea14 _dispatch_client_callout + 16
9  libdispatch.dylib              0x1840e896c _dispatch_queue_serial_drain$VARIANT$mp + 528
10 libdispatch.dylib              0x1840e92fc _dispatch_queue_invoke$VARIANT$mp + 340
11 libdispatch.dylib              0x1840e8824 _dispatch_queue_serial_drain$VARIANT$mp + 200
12 libdispatch.dylib              0x1840e92fc _dispatch_queue_invoke$VARIANT$mp + 340
13 libdispatch.dylib              0x1840e9d20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 404
14 libdispatch.dylib              0x1840f203c _dispatch_workloop_worker_thread$VARIANT$mp + 644
15 libsystem_pthread.dylib        0x184386f1c _pthread_wqthread + 932
16 libsystem_pthread.dylib        0x184386b6c start_wqthread + 4


I don't know how to reproduce it, but I keep getting crash reports like this on Crashlytics. And it's pretty common, it happened 4x last week.

--

For anyone encountering this thread.
We have encountered a similar crash:
<

Crashed: com.apple.CFNetwork.Connection

0 CoreFoundation 0x1848521e4 CFDictionaryGetValue + 100

1 CFNetwork 0x185026988 Tube::_onqueue_prepAllowedProtocols() + 264

2 CFNetwork 0x185026750 invocation function for block in Tube::_onqueue_connect() + 40

3 CFNetwork 0x185025d6c Tube::_onqueue_connect() + 172

4 CFNetwork 0x185025ca8 invocation function for block in Tube::initialize(BaseAwaitingTube*) + 44

5 libdispatch.dylib 0x184284aa0 _dispatch_call_block_and_release + 24

6 libdispatch.dylib 0x184284a60 _dispatch_client_callout + 16

7 libdispatch.dylib 0x18428e9b4 _dispatch_queue_serial_drain$VARIANT$mp + 608

8 libdispatch.dylib 0x18428f2fc _dispatch_queue_invoke$VARIANT$mp + 336

9 libdispatch.dylib 0x18428e86c _dispatch_queue_serial_drain$VARIANT$mp + 280

10 libdispatch.dylib 0x18428f2fc _dispatch_queue_invoke$VARIANT$mp + 336

11 libdispatch.dylib 0x18428fcc8 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340

12 libdispatch.dylib 0x184298098 _dispatch_workloop_worker_thread$VARIANT$mp + 668

13 libsystem_pthread.dylib 0x1845b7e70 _pthread_wqthread + 860

14 libsystem_pthread.dylib 0x1845b7b08 start_wqthread + 4

>
We also found a fix.
In our application we are loading a lot of images. These urls all had that http protocol, while it expected https.
The system seemed to handle the redirect for us, since we could see the images being loaded after another call to the same url, but with https protocol.
Older iOS version (before 12) apparently have problems with the large amount of extra requests/redirects.
After defaulting to using https for our images the crash disappeared.

Hi everyone,


I think I have the same problem:


#4. Crashed: com.apple.CFNetwork.Connection

0 libsystem_kernel.dylib 0x2117ad0e4 __pthread_kill

1 libsystem_pthread.dylib 0x211825afc pthread_kill

2 (Missing) 0x7e750211703fb0 (Missing)

3 (Missing) 0x308202116d0f20 (Missing)

4 (Missing) 0x4e7902123a0744 (Missing)

5 (Missing) 0x3d930212dcbda8 (Missing)

6 (Missing) 0x2cb40212b3c584 (Missing)

7 (Missing) 0x74a68211623b9c (Missing)

8 (Missing) 0x17648211625134 (Missing)

9 (Missing) 0x67c2021162c64c (Missing)

10 (Missing) 0x6b77821162d1d0 (Missing)

11 (Missing) 0x4391821162e394 (Missing)

12 (Missing) 0x6ad4821162de80 (Missing)

13 (Missing) 0x18a28211635480 (Missing)

14 (Missing) 0x65110211826b20 (Missing)

15 (Missing) 0x3db8021182cdd4 (Missing)



--



#0. com.apple.main-thread

0 libsystem_kernel.dylib 0x2117a1a3c mach_msg_trap

1 libsystem_kernel.dylib 0x2117a0ef8 mach_msg

2 (Missing) 0x71c18211bafee8 (Missing)

3 (Missing) 0x73da8211baab5c (Missing)

4 (Missing) 0x30c8211baa2e8 (Missing)

5 (Missing) 0x18360213e5ebe8 (Missing)

6 (Missing) 0x2b04823f8ec088 (Missing)

7 (Missing) 0x1269810243085c (Missing)

8 libdyld.dylib 0x21165d050 start



#1. com.apple.uikit.eventfetch-thread

0 libsystem_kernel.dylib 0x2117a1a3c mach_msg_trap

1 libsystem_kernel.dylib 0x2117a0ef8 mach_msg

2 (Missing) 0x24b08211bafee8 (Missing)

3 (Missing) 0x1eb20211baab5c (Missing)

4 (Missing) 0x60f00211baa2e8 (Missing)

5 (Missing) 0x35f802125ae3e0 (Missing)

6 (Missing) 0x1ec202125ae284 (Missing)

7 (Missing) 0xc9a823f9e2fc8 (Missing)

8 (Missing) 0x638a82125acfc0 (Missing)

9 (Missing) 0x183f02126e9c44 (Missing)

10 (Missing) 0x71e90211824974 (Missing)

11 (Missing) 0x4c5482118248d0 (Missing)

12 (Missing) 0x480821182cddc (Missing)



#2. com.twitter.crashlytics.ios.MachExceptionServer

0 libsystem_kernel.dylib 0x2117a1a3c mach_msg_trap

1 libsystem_kernel.dylib 0x2117a0ef8 mach_msg

2 (Missing) 0x13040103051ca0 (Missing)

3 libsystem_pthread.dylib 0x211824974 _pthread_body

4 (Missing) 0x5bc302118248d0 (Missing)

5 (Missing) 0x11eb821182cddc (Missing)



#3. Thread

0 libsystem_kernel.dylib 0x2117adb7c __workq_kernreturn

1 libsystem_pthread.dylib 0x211826b44 _pthread_wqthread

2 (Missing) 0x4f93021182cdd4 (Missing)



#4. Crashed: com.apple.CFNetwork.Connection

0 libsystem_kernel.dylib 0x2117ad0e4 __pthread_kill

1 libsystem_pthread.dylib 0x211825afc pthread_kill

2 (Missing) 0x7e750211703fb0 (Missing)

3 (Missing) 0x308202116d0f20 (Missing)

4 (Missing) 0x4e7902123a0744 (Missing)

5 (Missing) 0x3d930212dcbda8 (Missing)

6 (Missing) 0x2cb40212b3c584 (Missing)

7 (Missing) 0x74a68211623b9c (Missing)

8 (Missing) 0x17648211625134 (Missing)

9 (Missing) 0x67c2021162c64c (Missing)

10 (Missing) 0x6b77821162d1d0 (Missing)

11 (Missing) 0x4391821162e394 (Missing)

12 (Missing) 0x6ad4821162de80 (Missing)

13 (Missing) 0x18a28211635480 (Missing)

14 (Missing) 0x65110211826b20 (Missing)

15 (Missing) 0x3db8021182cdd4 (Missing)



#5. Thread

0 libsystem_kernel.dylib 0x2117adb7c __workq_kernreturn

1 libsystem_pthread.dylib 0x211826b44 _pthread_wqthread

2 (Missing) 0x5b99021182cdd4 (Missing)



#6. Thread

0 libsystem_kernel.dylib 0x2117adb7c __workq_kernreturn

1 libsystem_pthread.dylib 0x211826b44 _pthread_wqthread

2 (Missing) 0x4e92821182cdd4 (Missing)



#7. Thread

0 libsystem_kernel.dylib 0x2117adb7c __workq_kernreturn

1 libsystem_pthread.dylib 0x211826b44 _pthread_wqthread

2 (Missing) 0x499821182cdd4 (Missing)