未识别的 CFRunLoopRun 崩溃报告问题
Unidentified CFRunLoopRun crash report problem
我每天都会收到很多关于 CFRunLoopRun 错误的崩溃报告。它出现在 Xcode 和 iTunes Connect 崩溃报告中。但是,我没有收到用户反馈的任何崩溃报告。但是我不知道错误代码在哪里。当我打开 Xcode 项目的错误日志文件时,它只是指向 swift 文件中的一个空行。
该应用正在使用 WKWebView 和 Firebase SDK 进行分析。
如何解决这个崩溃问题?
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0xdead10cc
Termination Description: SPRINGBOARD, com.xxx.app was task-suspended with locked system files: | /var/mobile/Containers/Shared/AppGroup/9EAF384F-B017-4E91-BA24-1B9192E31220/database.db | ProcessVisibility: Background | ProcessState: Suspended
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000021c3b9c60 mach_msg_trap + 8
1 CoreFoundation 0x000000021c7c1e10 __CFRunLoopServiceMachPort + 240 (CFRunLoop.c:2615)
2 CoreFoundation 0x000000021c7bcab4 __CFRunLoopRun + 1344 (CFRunLoop.c:2971)
3 CoreFoundation 0x000000021c7bc254 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
4 GraphicsServices 0x000000021e9fbd8c GSEventRunModal + 108 (GSEvent.c:2245)
5 UIKitCore 0x0000000249b044c0 UIApplicationMain + 216 (UIApplication.m:4353)
6 Gear 0x0000000102591a94 main + 68 (BaseTabBarController.swift:14)
7 libdyld.dylib 0x000000021c278fd8 start + 4
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x000000021c3b9c60 mach_msg_trap + 8
1 CoreFoundation 0x000000021c7c1e10 __CFRunLoopServiceMachPort + 240 (CFRunLoop.c:2615)
2 CoreFoundation 0x000000021c7bcab4 __CFRunLoopRun + 1344 (CFRunLoop.c:2971)
3 CoreFoundation 0x000000021c7bc254 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
4 Foundation 0x000000021d19c04c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 (NSRunLoop.m:367)
5 Foundation 0x000000021d19bed4 -[NSRunLoop(NSRunLoop) runUntilDate:] + 100 (NSRunLoop.m:411)
6 UIKitCore 0x0000000249bf00d4 -[UIEventFetcher threadMain] + 140 (UIEventFetcher.m:606)
7 Foundation 0x000000021d19ac4c -[NSThread main] + 72 (NSThread.m:1212)
8 Foundation 0x000000021d2d0e54 __NSThread__start__ + 988 (NSThread.m:1175)
9 libsystem_pthread.dylib 0x000000021c43a908 _pthread_body + 132 (pthread.c:857)
10 libsystem_pthread.dylib 0x000000021c43a864 _pthread_start + 48 (pthread.c:884)
11 libsystem_pthread.dylib 0x000000021c442dcc thread_start + 4
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x000000021c3c4ed4 __psynch_cvwait + 8
1 libc++.1.dylib 0x000000021b9cc990 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:278)
2 JavaScriptCore 0x0000000223ae550c void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::uni... + 104 (condition_variable:204)
3 JavaScriptCore 0x0000000223ae9560 bmalloc::Scavenger::threadRunLoop() + 172 (condition_variable:213)
4 JavaScriptCore 0x0000000223ae8cfc bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*) + 16 (Scavenger.cpp:359)
5 JavaScriptCore 0x0000000223aea724 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, st... + 44 (type_traits:4345)
6 libsystem_pthread.dylib 0x000000021c43a908 _pthread_body + 132 (pthread.c:857)
7 libsystem_pthread.dylib 0x000000021c43a864 _pthread_start + 48 (pthread.c:884)
8 libsystem_pthread.dylib 0x000000021c442dcc thread_start + 4
Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x000000021c3b9c60 mach_msg_trap + 8
1 CoreFoundation 0x000000021c7c1e10 __CFRunLoopServiceMachPort + 240 (CFRunLoop.c:2615)
2 CoreFoundation 0x000000021c7bcab4 __CFRunLoopRun + 1344 (CFRunLoop.c:2971)
3 CoreFoundation 0x000000021c7bc254 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
4 CFNetwork 0x000000021cdddc88 -[__CoreSchedulingSetRunnable runForever] + 208 (CoreSchedulingSet.mm:1365)
5 Foundation 0x000000021d19ac4c -[NSThread main] + 72 (NSThread.m:1212)
6 Foundation 0x000000021d2d0e54 __NSThread__start__ + 988 (NSThread.m:1175)
7 libsystem_pthread.dylib 0x000000021c43a908 _pthread_body + 132 (pthread.c:857)
8 libsystem_pthread.dylib 0x000000021c43a864 _pthread_start + 48 (pthread.c:884)
9 libsystem_pthread.dylib 0x000000021c442dcc thread_start + 4
Thread 4:
0 libsystem_pthread.dylib 0x000000021c442dc0 start_wqthread + 0 (pthread_dependency.c:103)
Thread 5:
0 libsystem_pthread.dylib 0x000000021c442dc0 start_wqthread + 0 (pthread_dependency.c:103)
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000010004005 x1: 0x0000000007000806 x2: 0x0000000000000000 x3: 0x0000000000000c00
x4: 0x0000000000002a03 x5: 0x00000000ffffffff x6: 0x0000000000000000 x7: 0x0000000000000403
x8: 0x00000000fffffbbf x9: 0x0000000007000000 x10: 0x0000000007000000 x11: 0x000000b2f51efc80
x12: 0x00000000016e3600 x13: 0x000000000003757e x14: 0x000000000004b400 x15: 0x0004b40000000000
x16: 0xffffffffffffffe1 x17: 0x0000000000000001 x18: 0x0000000000000000 x19: 0x0000000000000000
x20: 0x00000000ffffffff x21: 0x0000000000002a03 x22: 0x0000000000000c00 x23: 0x000000016d872d30
x24: 0x0000000007000806 x25: 0x0000000000000000 x26: 0x0000000007000806 x27: 0x0000000000000c00
x28: 0x0000000000000001 fp: 0x000000016d872c20 lr: 0x000000021c3b90e8
sp: 0x000000016d872bd0 pc: 0x000000021c3b9c60 cpsr: 0x60000000
好吧,根据我在这件事上的有限经验,似乎 iOS 正试图在后台暂停您的应用程序,但由于您有一些后台进程 运行 而未能这样做。然后,由于您尚未在您的应用程序中启用后台处理功能,iOS 强制终止它,从而导致显示错误。
我建议仔细检查您的应用程序以查看是否存在任何内存泄漏或长 运行 进程。您应该通过将它们的使用与应用程序生命周期联系起来来解决这些问题(或考虑启用后台处理。有关 ARC、保留周期和捕获列表的使用的知识对于内存问题很重要)。
锁定的文件表明与 firebase 数据库有关。也许当您的应用程序处于后台时,您没有清除与 firebase 数据库的连接等...
这都是猜想。像这样的问题是特定于应用程序的,因为你做错了什么,你是识别它们的最佳人选,因为你对你的代码了如指掌。
编辑: 而且我也希望 com.xxx.app 确实是您的应用程序,而不是其他应用程序。
我每天都会收到很多关于 CFRunLoopRun 错误的崩溃报告。它出现在 Xcode 和 iTunes Connect 崩溃报告中。但是,我没有收到用户反馈的任何崩溃报告。但是我不知道错误代码在哪里。当我打开 Xcode 项目的错误日志文件时,它只是指向 swift 文件中的一个空行。
该应用正在使用 WKWebView 和 Firebase SDK 进行分析。
如何解决这个崩溃问题?
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0xdead10cc
Termination Description: SPRINGBOARD, com.xxx.app was task-suspended with locked system files: | /var/mobile/Containers/Shared/AppGroup/9EAF384F-B017-4E91-BA24-1B9192E31220/database.db | ProcessVisibility: Background | ProcessState: Suspended
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000021c3b9c60 mach_msg_trap + 8
1 CoreFoundation 0x000000021c7c1e10 __CFRunLoopServiceMachPort + 240 (CFRunLoop.c:2615)
2 CoreFoundation 0x000000021c7bcab4 __CFRunLoopRun + 1344 (CFRunLoop.c:2971)
3 CoreFoundation 0x000000021c7bc254 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
4 GraphicsServices 0x000000021e9fbd8c GSEventRunModal + 108 (GSEvent.c:2245)
5 UIKitCore 0x0000000249b044c0 UIApplicationMain + 216 (UIApplication.m:4353)
6 Gear 0x0000000102591a94 main + 68 (BaseTabBarController.swift:14)
7 libdyld.dylib 0x000000021c278fd8 start + 4
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x000000021c3b9c60 mach_msg_trap + 8
1 CoreFoundation 0x000000021c7c1e10 __CFRunLoopServiceMachPort + 240 (CFRunLoop.c:2615)
2 CoreFoundation 0x000000021c7bcab4 __CFRunLoopRun + 1344 (CFRunLoop.c:2971)
3 CoreFoundation 0x000000021c7bc254 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
4 Foundation 0x000000021d19c04c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 (NSRunLoop.m:367)
5 Foundation 0x000000021d19bed4 -[NSRunLoop(NSRunLoop) runUntilDate:] + 100 (NSRunLoop.m:411)
6 UIKitCore 0x0000000249bf00d4 -[UIEventFetcher threadMain] + 140 (UIEventFetcher.m:606)
7 Foundation 0x000000021d19ac4c -[NSThread main] + 72 (NSThread.m:1212)
8 Foundation 0x000000021d2d0e54 __NSThread__start__ + 988 (NSThread.m:1175)
9 libsystem_pthread.dylib 0x000000021c43a908 _pthread_body + 132 (pthread.c:857)
10 libsystem_pthread.dylib 0x000000021c43a864 _pthread_start + 48 (pthread.c:884)
11 libsystem_pthread.dylib 0x000000021c442dcc thread_start + 4
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x000000021c3c4ed4 __psynch_cvwait + 8
1 libc++.1.dylib 0x000000021b9cc990 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:278)
2 JavaScriptCore 0x0000000223ae550c void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::uni... + 104 (condition_variable:204)
3 JavaScriptCore 0x0000000223ae9560 bmalloc::Scavenger::threadRunLoop() + 172 (condition_variable:213)
4 JavaScriptCore 0x0000000223ae8cfc bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*) + 16 (Scavenger.cpp:359)
5 JavaScriptCore 0x0000000223aea724 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, st... + 44 (type_traits:4345)
6 libsystem_pthread.dylib 0x000000021c43a908 _pthread_body + 132 (pthread.c:857)
7 libsystem_pthread.dylib 0x000000021c43a864 _pthread_start + 48 (pthread.c:884)
8 libsystem_pthread.dylib 0x000000021c442dcc thread_start + 4
Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x000000021c3b9c60 mach_msg_trap + 8
1 CoreFoundation 0x000000021c7c1e10 __CFRunLoopServiceMachPort + 240 (CFRunLoop.c:2615)
2 CoreFoundation 0x000000021c7bcab4 __CFRunLoopRun + 1344 (CFRunLoop.c:2971)
3 CoreFoundation 0x000000021c7bc254 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
4 CFNetwork 0x000000021cdddc88 -[__CoreSchedulingSetRunnable runForever] + 208 (CoreSchedulingSet.mm:1365)
5 Foundation 0x000000021d19ac4c -[NSThread main] + 72 (NSThread.m:1212)
6 Foundation 0x000000021d2d0e54 __NSThread__start__ + 988 (NSThread.m:1175)
7 libsystem_pthread.dylib 0x000000021c43a908 _pthread_body + 132 (pthread.c:857)
8 libsystem_pthread.dylib 0x000000021c43a864 _pthread_start + 48 (pthread.c:884)
9 libsystem_pthread.dylib 0x000000021c442dcc thread_start + 4
Thread 4:
0 libsystem_pthread.dylib 0x000000021c442dc0 start_wqthread + 0 (pthread_dependency.c:103)
Thread 5:
0 libsystem_pthread.dylib 0x000000021c442dc0 start_wqthread + 0 (pthread_dependency.c:103)
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000010004005 x1: 0x0000000007000806 x2: 0x0000000000000000 x3: 0x0000000000000c00
x4: 0x0000000000002a03 x5: 0x00000000ffffffff x6: 0x0000000000000000 x7: 0x0000000000000403
x8: 0x00000000fffffbbf x9: 0x0000000007000000 x10: 0x0000000007000000 x11: 0x000000b2f51efc80
x12: 0x00000000016e3600 x13: 0x000000000003757e x14: 0x000000000004b400 x15: 0x0004b40000000000
x16: 0xffffffffffffffe1 x17: 0x0000000000000001 x18: 0x0000000000000000 x19: 0x0000000000000000
x20: 0x00000000ffffffff x21: 0x0000000000002a03 x22: 0x0000000000000c00 x23: 0x000000016d872d30
x24: 0x0000000007000806 x25: 0x0000000000000000 x26: 0x0000000007000806 x27: 0x0000000000000c00
x28: 0x0000000000000001 fp: 0x000000016d872c20 lr: 0x000000021c3b90e8
sp: 0x000000016d872bd0 pc: 0x000000021c3b9c60 cpsr: 0x60000000
好吧,根据我在这件事上的有限经验,似乎 iOS 正试图在后台暂停您的应用程序,但由于您有一些后台进程 运行 而未能这样做。然后,由于您尚未在您的应用程序中启用后台处理功能,iOS 强制终止它,从而导致显示错误。
我建议仔细检查您的应用程序以查看是否存在任何内存泄漏或长 运行 进程。您应该通过将它们的使用与应用程序生命周期联系起来来解决这些问题(或考虑启用后台处理。有关 ARC、保留周期和捕获列表的使用的知识对于内存问题很重要)。
锁定的文件表明与 firebase 数据库有关。也许当您的应用程序处于后台时,您没有清除与 firebase 数据库的连接等...
这都是猜想。像这样的问题是特定于应用程序的,因为你做错了什么,你是识别它们的最佳人选,因为你对你的代码了如指掌。
编辑: 而且我也希望 com.xxx.app 确实是您的应用程序,而不是其他应用程序。