There are multiple report of crashes on URLConnectionLoader::loadWithWhatToDo. The crashed thread in the stack traces pointing to calls inside CFNetwork which seems to be internal library in iOS.
The crash has happened quite a while already (but we cannot detect when the crash started to occur) and impacted multiple iOS versions recorded from iOS 15.4 to 18.4.1 that was recorded in Xcode crash report organizer so far.
Unfortunately, we have no idea on how to reproduce it yet but the crash keeps on increasing and affect more on iOS 18 users (which makes sense because many people updated their iOS to the newer version) and we haven’t found any clue on what actually happened and how to fix it on the crash reports. What we understand is it seems to come from a network request that happened to trigger the crash but we need more information on what (condition) actually cause it and how to solve it.
Hereby, I attach sample crash report for both iOS 15 and 18. I also have submitted a report (that include more crash reports) with number: FB17775979.
Will appreciate any insight regarding this issue and any resolution that we can do to avoid it.
Thanks for that.
The crashing code, frame 0 of thread 28, is in _dispatch_source_set_runloop_timer_4CF
. I’ve seen this before, and some digging around in my own records points to an issue with CFNetwork (r. 26038149). I originally thought we fixed this back in 2022, but my latest reading of that bug suggests that the fix was not a complete fix. Rather, it was a mitigation that was intended to significantly reduce the occurrences of this crash.
As to what you can do about this, the issue here is a race condition with CFNetwork and there’s nothing you’re doing wrong that’s triggering it. In terms of a workaround, I do have one suggestion for you: Try disabling the classic loading mode by setting the usesClassicLoadingMode
property to false. This race condition is in the classic loader, so switching to the modern loader should avoid the issue. However, it’s possible that it might trigger other issues, so make sure to test your product thoroughly before shipping it that way.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"