简体   繁体   English

CFNetwork 在 iOS 中使用 swift 崩溃

[英]CFNetwork crash using swift in iOS

I have the following crash in my application but I cannot reproduce it to find its source.我的应用程序中有以下崩溃,但我无法重现它以找到它的来源。 The main work is multiple asynchronous network upload requests, which are placed in a concurrent OperationQueue and support background transition too.主要工作是多个异步网络上传请求,它们放置在一个并发的OperationQueue中,也支持后台转换。

Crashed: NSOperationQueue 0x174037ae0 :: NSOperation 0x17044f7b0 (QOS: DEFAULT) EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000ce6fabec8崩溃:NSOperationQueue 0x174037ae0 :: NSOperation 0x17044f7b0 (QOS: DEFAULT) EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000ce6fabec8

Crashed: NSOperationQueue 0x170036660 :: NSOperation 0x17425e360 (QOS: DEFAULT)崩溃:NSOperationQueue 0x170036660 :: NSOperation 0x17425e360 (QOS: DEFAULT)

0  libobjc.A.dylib                0x181c21704 objc_object::release() + 8
1  CFNetwork                      0x1839a196c __destroy_helper_block_.465 + 40
2  libsystem_blocks.dylib         0x1820afa28 _Block_release + 144
3  Foundation                     0x183c0623c -[NSBlockOperation dealloc] + 64
4  Foundation                     0x183cc245c __NSOQSchedule_f + 484
5  libdispatch.dylib              0x18205a1bc _dispatch_client_callout + 16
6  libdispatch.dylib              0x1820683dc _dispatch_queue_serial_drain + 928
7  libdispatch.dylib              0x18205d9a4 _dispatch_queue_invoke + 652
8  libdispatch.dylib              0x18206a34c _dispatch_root_queue_drain + 572
9  libdispatch.dylib              0x18206a0ac _dispatch_worker_thread3 + 124
10 libsystem_pthread.dylib        0x1822632a0 _pthread_wqthread + 1288
11 libsystem_pthread.dylib        0x182262d8c start_wqthread + 4

The app is written in Swift 3 .该应用程序是用Swift 3编写的。 Is there anything you can propose?你有什么可以提出的吗?

I just resolved this exact same crash log by updating a 3rd party library.我刚刚通过更新 3rd 方库解决了这个完全相同的崩溃日志。 The issue in that library was defining a block object as (strong, nonatomic) instead of (copy).该库中的问题是将块对象定义为(强,非原子)而不是(复制)。 It was an Objective-C library, but the same strong/weak principles would apply with Swift block object properties.它是一个 Objective-C 库,但同样的强/弱原则也适用于 Swift 块对象属性。 If those blocks were added to an NSOperationQueue, you could see that error.如果将这些块添加到 NSOperationQueue 中,您会看到该错误。 Do you have any strong block properties or any strong references in NSOperationQueues? NSOperationQueues 中是否有任何强块属性或任何强引用?

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

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