简体   繁体   English

EXC_BAD_INSTRUCTION 来自 com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit

[英]EXC_BAD_INSTRUCTION from com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export

I have an app that runs fine on iOS, but when running with catalyst, it gives me this crash intermittently if I swipe to another virtual Desktop on macOS, and then back, for about 10 times.我有一个在 iOS 上运行良好的应用程序,但是当使用催化剂运行时,如果我在 macOS 上滑动到另一个虚拟桌面,然后再返回大约 10 次,它会间歇性地崩溃。 It mostly happens on a UICollectionViewController它主要发生在 UICollectionViewController

This is the backtrace:这是回溯:

(lldb) bt
* thread #5, queue = 'com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x00007fff68c373ae libxpc.dylib`___xpc_activity_dispatch_block_invoke.107.cold.3 + 19
    frame #1: 0x00007fff68c1ecdb libxpc.dylib`___xpc_activity_dispatch_block_invoke.107 + 746
    frame #2: 0x00000001010377b3 libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #3: 0x000000010103878f libdispatch.dylib`_dispatch_client_callout + 8
    frame #4: 0x000000010103fd31 libdispatch.dylib`_dispatch_lane_serial_drain + 777
    frame #5: 0x0000000101040ae8 libdispatch.dylib`_dispatch_lane_invoke + 438
    frame #6: 0x000000010104df2e libdispatch.dylib`_dispatch_workloop_worker_thread + 681
    frame #7: 0x00000001010c4053 libsystem_pthread.dylib`_pthread_wqthread + 290
    frame #8: 0x00000001010c3eb3 libsystem_pthread.dylib`start_wqthread + 15
(lldb) 

I have tried reviewing the codes, adding print statements, adding breakpoints, commenting out certain parts etc, trying to figure out which part of my code causes this, but failed so far.我尝试过查看代码、添加打印语句、添加断点、注释掉某些部分等,试图找出我的代码的哪一部分导致了这种情况,但到目前为止失败了。

I am using NSPersistentCloudKitContainer from iOS 13. Does the stack trace points to a bug inside there?我正在使用 iOS 13 中的 NSPersistentCloudKitContainer。堆栈跟踪是否指向那里的错误?

I've wasted so much time trying to understand the source of the problem and hope that this answer helps many others.我浪费了很多时间试图了解问题的根源,并希望这个答案能帮助许多其他人。

This problems seems to persist now since a long time and has not been fixed, nor understood.这个问题似乎已经存在很长时间了,并且没有得到解决,也没有被理解。 But the big hint I've read in the comments: This crash happens only when the app is run from within Xcode.但我在评论中读到的重要提示:只有当应用程序从 Xcode 中运行时才会发生这种崩溃。

Another important hint: You can can run your build product directly from Finder without crashing.另一个重要提示:您可以直接从 Finder 运行构建产品而不会崩溃。 Even if it is a "Debug" build.即使它是“调试”版本。

Based on this, I've come to the conclusion that the problem is related to the Debug execution environment and I found the solution: Disable "Debug XPC services used by this application"基于此,我得出的结论是问题与Debug执行环境有关,我找到了解决方案:禁用“Debug XPC services used by this application”
There must be some bug in the debugging code used by this option.此选项使用的调试代码中一定存在一些错误。

You can find this option in your targets scheme.您可以在目标方案中找到此选项。

  1. Click on your target in the window bar在 window 栏中单击您的目标
  2. Select "Edit Scheme..." Select "编辑方案..."
  3. Make sure "Run" is selected and remove the checkmark for "Debug XPC services used by this application"确保选中“运行”并取消选中“调试此应用程序使用的 XPC 服务”的复选标记

I hope this helps everybody!我希望这对大家有帮助!

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

相关问题 iTunesconnect.apple.com 上未显示活动选项卡 - Activity tab not showing on itunesconnect.apple.com 使com.apple.CoreData.ConcurrencyDebug 1工作 - Making com.apple.CoreData.ConcurrencyDebug 1 work com.apple.CoreData.SQLDebug无效 - com.apple.CoreData.SQLDebug not working 名为com.apple.commcenter.coretelephony.xpc的服务连接无效 - The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated Xcode 11.1 似乎打破了 com.apple.commcenter.coretelephony.xpc - Xcode 11.1 seems to break com.apple.commcenter.coretelephony.xpc 苹果的Cloudkit迁移 - Apple's Cloudkit Migration com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS(来自iOS 8.x的NSTimer) - com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS (at NSTimer from iOS 8.x) “Thread 6 com.apple.NSURLConnectionLoader:Program received signal:EXC_BAD_ACCESS” - “Thread 6 com.apple.NSURLConnectionLoader: Program received signal: EXC_BAD_ACCESS” cellForRowAt中的com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS - com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS in cellForRowAt com.apple.NSURLSession-work EXC_BAD_ACCESS 崩溃调试 - com.apple.NSURLSession-work EXC_BAD_ACCESS Crash debugging
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM