iosswiftcrashcfnetwork

How to fix CFNetwork issue iOS swift?


I have a doubt regarding crashes. In our app, we are getting CFNetwork issues randomly. When we checked the stack trace, we don't have any idea about reproducing. What's the main reason of getting CFNetwork error?

I am using the below third parties:

pod 'Alamofire', '~> 4.7.3'
pod 'Branch'
pod 'Fabric'
pod 'Crashlytics'
pod 'PPpdf417', '~> 5.1.0'
pod 'JGProgressHUD'
pod 'Firebase/Core'
pod 'Firebase/Messaging'

Crash 1:

Crashed: com.apple.CFNetwork.LoaderQ 0 CFNetwork
0x1c14d7f00 HTTPProtocol::shouldAttemptOriginLoad() + 40 1 CFNetwork 0x1c14d7ef4 HTTPProtocol::shouldAttemptOriginLoad() + 28 2 (Missing) 0x748801c14d7a50 (Missing) 3 (Missing)
0x6e3e01c1537b0c (Missing) 4 (Missing)
0x63a881c15352f0 (Missing) 5 (Missing)
0x2f5401c16019e0 (Missing) 6 (Missing)
0x4d3981c0808374 (Missing) 7 (Missing)
0x4a4901c08098f4 (Missing)

Crash 2:



Crashed: com.apple.CFNetwork.LoaderQ 0 libsystem_kernel.dylib
0x1b7ea3104 __pthread_kill + 8 1 libsystem_pthread.dylib
0x1b7f23948 pthread_kill$VARIANT$armv81 + 296 2 libsystem_c.dylib
0x1b7dfad78 abort + 140 3 libsystem_malloc.dylib 0x1b7ef7768 _malloc_put + 570 4 libsystem_malloc.dylib 0x1b7ef7998 malloc_zone_error + 104 5 libsystem_malloc.dylib 0x1b7ef7258 free_list_checksum_botch + 36 6 libsystem_malloc.dylib
0x1b7ef31c4 tiny_free_list_remove_ptr + 488 7 libsystem_malloc.dylib 0x1b7ef3f90 tiny_free_no_lock + 1544 8 libsystem_malloc.dylib
0x1b7ef4dc8 free_tiny + 376 9 CoreFoundation
0x1b829f978 _CFRelease + 824 10 CFNetwork
0x1b8afbe28 HTTPEngine::~HTTPEngine() + 212

Crash 3:

Fatal Exception: NSInvalidArgumentException 0 CoreFoundation
0x1b7e13758 __exceptionPreprocess 1 libobjc.A.dylib
0x1b701bd00 objc_exception_throw 2 CoreFoundation
0x1b7d198b4 -[NSCache init] 3 UIKitCore
0x1e46aee48 -[UIPageViewController _validatedViewControllersForTransitionWithViewControllers:animated:] 4 UIKitCore 0x1e46afa24 -[UIPageViewController _setViewControllers:withCurlOfType:fromLocation:direction:animated:notifyDelegate:completion:] 5 UIKitCore 0x1e46b29f8 -[UIPageViewController _handlePanGesture:] 6 UIKitCore 0x1e4904608 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] 7 UIKitCore 0x1e490cab8 _UIGestureRecognizerSendTargetActions 8 UIKitCore 0x1e490a3b4 _UIGestureRecognizerSendActions 9 UIKitCore
0x1e4909888 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent

I can’t able to reproduce the crash? Another way to identify this or Give me an idea to fix this kind of errors ?


Solution

  • Please check this https://forums.developer.apple.com/message/346841#346841

    It happens only on iOS12 And I've found guys using Alamofire/Moya/RxSwift could get this issue

    How do you send your request, just Alamofire or Moya?