简体   繁体   English

如何修复 CFNetwork 问题 iOS swift?

[英]How to fix CFNetwork issue iOS swift?

I have a doubt regarding crashes.我对崩溃有疑问。 In our app, we are getting CFNetwork issues randomly.在我们的应用程序中,我们随机收到 CFNetwork 问题。 When we checked the stack trace, we don't have any idea about reproducing.当我们检查堆栈跟踪时,我们对复制没有任何想法。 What's the main reason of getting CFNetwork error?出现 CFNetwork 错误的主要原因是什么?

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:崩溃 1:

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

Crash 2:崩溃 2:

Crashed: com.apple.CFNetwork.LoaderQ 0 libsystem_kernel.dylib崩溃:com.apple.CFNetwork.LoaderQ 0 libsystem_kernel.dylib
0x1b7ea3104 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1b7ea3104 __pthread_kill + 8 1 libsystem_pthread.dylib
0x1b7f23948 pthread_kill$VARIANT$armv81 + 296 2 libsystem_c.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 0x1b7dfad78 中止 + 140 3 libsystem_malloc.dylib 0x1b7ef7768 _malloc_put + 570 4 libsystem_malloc.dylib 0x1b7ef7998 malloc_zone_error + 104 5 libsystem_malloc.dylib + 0x51bch 7 freebot 0x18 loc 0x18 0x18 0x18 0x18 _
0x1b7ef31c4 tiny_free_list_remove_ptr + 488 7 libsystem_malloc.dylib 0x1b7ef3f90 tiny_free_no_lock + 1544 8 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 0x1b7ef4dc8 free_tiny + 376 9 核心基金会
0x1b829f978 _CFRelease + 824 10 CFNetwork 0x1b829f978 _CFRelease + 824 10 CFNetwork
0x1b8afbe28 HTTPEngine::~HTTPEngine() + 212 0x1b8afbe28 HTTPEngine::~HTTPEngine() + 212

Crash 3:崩溃3:

Fatal Exception: NSInvalidArgumentException 0 CoreFoundation致命异常:NSInvalidArgumentException 0 CoreFoundation
0x1b7e13758 __exceptionPreprocess 1 libobjc.A.dylib 0x1b7e13758 __exceptionPreprocess 1 libobjc.A.dylib
0x1b701bd00 objc_exception_throw 2 CoreFoundation 0x1b701bd00 objc_exception_throw 2 核心基金会
0x1b7d198b4 -[NSCache init] 3 UIKitCore 0x1b7d198b4 -[NSCache 初始化] 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 0x1e46aee48 - [UIPageViewController _validatedViewControllersForTransitionWithViewControllers:动画:] 4 UIKitCore 0x1e46afa24 - [UIPageViewController _setViewControllers:withCurlOfType:fromLocation:方向:动画:notifyDelegate:完成:] 5 UIKitCore 0x1e46b29f8 - [UIPageViewController _handlePanGesture:] 6 UIKitCore 0x1e4904608 - [UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] 7 UIKitCore 0x1e490cab8 _UIGestureRecognizerSendTargetActions 8 UIKitCore 0x1e490a3b4 _UIGestureRecognizerSendActions 9 UIKitCore
0x1e4909888 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent 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 ?识别此问题的另一种方法或给我一个解决此类错误的想法?

Please check this https://forums.developer.apple.com/message/346841#346841请检查这个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它只发生在 iOS12 上我发现使用 Alamofire/Moya/RxSwift 的人可能会遇到这个问题

How do you send your request, just Alamofire or Moya?你如何发送你的请求,只是 Alamofire 或 Moya?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM