"CFNetwork" heap curruption crash on iOS 14

We are facing this crash extensively on iOS 14. We have seen multiple variants of this crash that look similar.

We have used third party pods "Alamofire ~ 4.9.1", and "SDWebImage ~ 5.7.2" for network related operations

Crash report:
Crashed: com.apple.CFNetwork.Connection
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000004a11a5a00
Crashed: com.apple.CFNetwork.LoaderQ
0 libobjc.A.dylib 0x1a9e98020 objc_release + 16
1 CoreFoundation 0x194e2e0b4 __CFURLDeallocate + 52
2 CoreFoundation 0x194dde104 _CFRelease + 248
3 CFNetwork 0x19565f950 _CFHTTPServerResponseEnqueue + 62048
4 CoreFoundation 0x194dde104 _CFRelease + 248
5 CFNetwork 0x195479358 CFNetServiceBrowserSearchForServices + 60540
6 CFNetwork 0x19568a828 __CFNetworkAgentMessageProcessorMain + 107784
7 CFNetwork 0x1954958a8 _CFHTTPMessageSetResponseProxyURL + 30984
8 CFNetwork 0x195623c24 _CFNetworkHTTPConnectionCacheSetLimit + 65256
9 CFNetwork 0x195623048 _CFNetworkHTTPConnectionCacheSetLimit + 62220
10 CFNetwork 0x195622ecc _CFNetworkHTTPConnectionCacheSetLimit + 61840
11 CFNetwork 0x1955c0744 _CFStreamErrorFromCFError + 524040
12 libsystem_blocks.dylib 0x1e091c764 _Block_release + 200
13 libsystem_blocks.dylib 0x1e091c764 _Block_release + 200
14 libdispatch.dylib 0x194a54db0 _dispatch_client_callout + 20
15 libdispatch.dylib 0x194a5c10c _dispatch_lane_serial_drain + 580
16 libdispatch.dylib 0x194a5cc90 _dispatch_lane_invoke + 460
17 libdispatch.dylib 0x194a5de60 _dispatch_workloop_invoke + 1588
18 libdispatch.dylib 0x194a66d78 _dispatch_workloop_worker_thread + 708
19 libsystem_pthread.dylib 0x1e0989814 _pthread_wqthread + 276
20 libsystem_pthread.dylib 0x1e099076c start_wqthread + 8

We are facing this crash extensively on iOS 14. We have seen multiple
variants of this crash that look similar.

Please post a full Apple crash report for this problem. Use the text attachment feature (the paperclip icon) to avoid clogging up the timeline.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Hey Eskimo, please find the crash details here to get more insight on the issue


Thanks.

Crashes like this clearly indicate a memory management problem. The issue is to decide whether this is a problem with the system or a problem with your app. Looking at our records we’ve see a bunch of crashes like this from a bunch of different apps over the years, and that suggests an OS problem. However, that’s not definitive. Memory management problems in apps are quite common, and it could just be that CFNetwork in an innocent bystander here.

The next step here is to run your app under the standard memory debugging tools, and specifically Zombies, to see if you can get it to reproduce more frequently.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Thanks, Eskimo, we are using this Library since the beginning but this problem popped recently. We will investigate at our end for any potential memory leaks or Zombie thread but please do help us investigating on the OS level as well, Thanks.

Hey @Eskimo, any updates on this? We did the memory instrumentation at our end, enabling zombies. We got crash only on memory limit reached, no corruption crash observed

The fact that Zombies hasn’t flagged anything makes it more likely that this is an OS bug. Can you reproduce this in your office?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

"CFNetwork" heap curruption crash on iOS 14
 
 
Q