CFNetwork crash on iOS 12

Since the release of iOS 12 I have noticed quite a lot of crash reports related to CFNetwork. The exception type is EXC_BAD_ACCESS and is raised at HTTPProtocol::shouldAttemptOriginLoad. Unfortunately I haven't seen any other posts related to this crash. It only occurs on iOS 12.x.

Replies

I have a similar crash that I think might be related.

Thanks for the crash report but, honestly, I don’t think it’s related, other than the fact that the crashing backtrace leads to CFNetwork. Looking at frame 1 of the crashing three, I see it pointing to

-[__NSURLSessionLocal _withXURLCache:]
, which is called when the session wants to use its associated
NSURLCache
instance. The crashes posted above are much deeper in CFNetwork, in the core HTTP protocol implementation.

It’s possible that your crash is a bug in CFNetwork itself, but it’s not impossible that there’s a problem in your app. If you haven’t already done so, I recommend that you start out by running your app under the standard memory debugging tools.

Share and Enjoy

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

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

Thanks Quinn! For what it's worth, we have a couple hundred users on the open beta of iOS 13 who haven't hit this (other crash) yet, so I'm still hopeful something changed that magically made this crash less likely, but it's too soon to say.


Thanks for the memory debugging post!


- Jon