【问题标题】:CoreData multithreading_violation debuggingCoreData multithreading_violation 调试
【发布时间】:2015-04-20 07:10:50
【问题描述】:

我们在多线程上使用核心数据,并且遇到了 multithreading_violation。通常它很容易修复,查看违规位置并确保代码在 performBlock 调用中执行。

今天的问题是调用堆栈没有指向任何给我太多线索的东西。我想有人可能对如何追踪这个有一些见解

#0  0x05e40f63 in +[NSManagedObjectContext __Multithreading_Violation_AllThatIsLeftToUsIsHonor__] ()
#1  0x05e4138b in _PFAssertSafeMultiThreadedAccess_impl ()
#2  0x05e0c15d in -[_PFBatchFaultingArray dealloc] ()
#3  0x05e0c1dd in -[_PFBatchFaultingArray release] ()
#4  0x07130eb1 in objc_release ()
#5  0x07131d32 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#6  0x080d0536 in _dispatch_root_queue_drain ()
#7  0x080d1b70 in _dispatch_worker_thread3 ()
#8  0x0842d1da in _pthread_wqthread ()
#9  0x0842ae2e in start_wqthread ()

【问题讨论】:

    标签: ios multithreading core-data


    【解决方案1】:

    我遇到了同样的问题,只是注意到当我不批量获取数据时没有出现错误,即不要在 NSFetchRequest 上设置 fetchBatchSize。

    这可能是 iOS 8.3 PFBatchFaultingArray 实现中的一个错误。

    【讨论】:

    • 在 iOS12 上遇到了同样的情况,删除了fetchBatchSize,一切顺利。很好奇,如果它的 bug 是 multithreading_violation 还是 PFBatchFaultingArray
    猜你喜欢
    • 1970-01-01
    • 2020-01-14
    • 1970-01-01
    • 2015-10-22
    • 2017-05-01
    • 2014-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多