iOS 13 - 崩溃:com.apple.main-thread EXC_BREAKPOINT (CoreFoundation)

iOS 13 - Crashed: com.apple.main-thread EXC_BREAKPOINT (CoreFoundation)

我已经开始收到 Fabric 为我的 iOS 应用程序报告的大量崩溃,该应用程序已在 App Store 上发布。仅从 18 Sep 开始报告 iOS 13 的崩溃。这是崩溃的主线程的崩溃日志。

Crashed: com.apple.main-thread
0  CoreFoundation                 0x185180408 OUTLINED_FUNCTION_0 + 4
1  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
2  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
3  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
4  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
5  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
6  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
7  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
8  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
9  CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
10 CoreFoundation                 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14

有人面临类似的崩溃吗?我怎样才能摆脱这个问题?

我的应用程序有同样的情况。 在我将数据保护更改为 "Complete until first user authentication" 后,我的应用程序不再崩溃。

作为 Alex 的 ,

It seems that the dyld3 saves the generated clojure files in the app tmp directory and if you use NSFileProtectionComplete the closure files have this property too.

To generate a crahs close the app, lock the phone, send a push that will wake up the app and then the crash is generated.

The solution seems to be simple, just change the permissions for the app tmp direcptry to NSFileProtectionCompleteUntilFirstUserAuthentication and the app will not crash. I really don't know why apple did this.

这对我有用。

复制与测试

雷恩评论

You don't necessarily need to use push notifications to reproduce the issue. If your app is configured to use complete file protection in the entitlements, any code that runs while protected data is unavailable will cause the app to crash. For example, my company's app has a background task that takes longer than 10 seconds to execute. Since protected data becomes unavailable around 10 seconds after locking the device, the app will crash before the background task can finish executing (despite having more time available on the assertion).