【发布时间】:2016-06-20 13:26:21
【问题描述】:
我使用 crashlytics 来获取 AppStore 中我的应用的崩溃情况。一些用户遇到了我似乎无法在我的机器上重现的崩溃(通过 TestFlight 测试我的应用程序的少数朋友也没有)。这是来自 Fabric 的日志:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x181d09bdc objc_msgSend + 28
1 Foundation 0x18304be20 __NSThreadPerformPerform + 340
2 CoreFoundation 0x182640efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
3 CoreFoundation 0x182640990 __CFRunLoopDoSources0 + 540
4 CoreFoundation 0x18263e690 __CFRunLoopRun + 724
5 CoreFoundation 0x18256d680 CFRunLoopRunSpecific + 384
6 GraphicsServices 0x183a7c088 GSEventRunModal + 180
7 UIKit 0x1873e4d90 UIApplicationMain + 204
8 <App Name> 0x1000b2f0c main (AppDelegate.swift:14)
9 libdispatch.dylib 0x18210e8b8 (Missing)
我似乎无法理解这意味着什么,并搜索了其他问题以寻求帮助,但似乎找不到答案。我也很快联系了 Crashlytics 团队,他们告诉我以下内容:
听起来这个崩溃的根源是某种内存不足的崩溃。这会导致 Crashlytics 在完成写入之前关闭,从而导致您的崩溃报告中出现这种情况。
有什么好的方法来调试它以查明崩溃的根源吗?感谢您的帮助!
编辑: 在 crashlytics 的崩溃报告中添加了线程的屏幕截图,以防有人想从那里获取一些信息:
Thread : com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x1823354bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x182335338 mach_msg + 72
2 CoreFoundation 0x182764ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x1827627c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x182691680 CFRunLoopRunSpecific + 384
5 CFNetwork 0x182e01434 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
6 Foundation 0x18316fc40 __NSThread__start__ + 1000
7 libsystem_pthread.dylib 0x182417b28 _pthread_body + 156
8 libsystem_pthread.dylib 0x182417a8c _pthread_body + 154
9 libsystem_pthread.dylib 0x182415028 thread_start + 4
Thread : AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x1823354bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x182335338 mach_msg + 72
2 CoreFoundation 0x182764ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x1827627c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x182691680 CFRunLoopRunSpecific + 384
5 libAVFAudio.dylib 0x188959834 GenericRunLoopThread::Entry(void*) + 164
6 libAVFAudio.dylib 0x18892e3a8 CAPThread::Entry(CAPThread*) + 84
7 libsystem_pthread.dylib 0x182417b28 _pthread_body + 156
8 libsystem_pthread.dylib 0x182417a8c _pthread_body + 154
9 libsystem_pthread.dylib 0x182415028 thread_start + 4
编辑 2: 我正在使用所有 Swift 代码,我将消息转发到选择器的方式如下:
NSTimer.scheduledTimerWithTimeInterval(0.02, target: self, selector: Selector("updateProgressCircle"), userInfo: nil, repeats: true)
func updateProgressCircle() {
// Do something
}
问题是我无法在本地重现任何崩溃。只有用户面临这个问题。我以类似的方式调用选择器。
【问题讨论】:
-
崩溃没有更多信息或控制台输出?
-
添加了其他线程运行的截图(我只复制了主线程的信息)。这就是我可以从崩溃报告中得到的全部信息。检查编辑的问题
标签: ios iphone swift crash crashlytics