-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signal Crash #13
Comments
感谢反馈。我刚刚试了3次,都能正常打印,能否提供更多细节 |
点击 |
原来就是可以正常打印=。=,我试了几次也能正常打印,好奇怪 |
我是直接下的源码跑真机的😂 |
对了,crash相关的你不能连着Xcode的debugger,Xcode的debugger优先级比较高,会导致crash监控被debugger吃掉😂 |
装完拔掉线重新打开app测试的,🤔 |
在 //MARK: - CrashEye
extension ConsoleController: CrashEyeDelegate {
/// god's crash eye callback
func crashEyeDidCatchCrash(with model:CrashModel) {
let model = CrashRecordModel(model: model)
model.insertSync(complete: { [unowned self] (success:Bool) in
self.addRecord(model: model)
})
}
} 你用 |
没发现有打印什么= = |
|
放在第一行:
因为系统在crash的时候留给app做处理的时间极短,而这边又需要将crash数据保存到数据库中,需要一些I/O,因此你放后面可能就执行不到了。。。 |
不过照你的说法Exception Crash后会把之前的Signle日志打印出来,至少能说明crash数据当时是正常保存的 |
|
找到原因了,在Swift的代码Crash的Signal Crash都是通过SIGTRAP信号往上抛的,我没监听这个信号,所以你没看到crash堆栈,(奇怪的是在模拟器是通过SIGILL信号往上抛,所以模拟器能捕获到)。 参考http://stackoverflow.com/questions/36325140/how-to-catch-a-swift-crash-and-do-some-logging 然后,迷惑的来了,在Swift中OC的类Crash,也就是Exception Crash的同时会抛出一个SIGABRT信号,所以当你点击Exception Crash后发现,可以看到SIGNAL Crash的堆栈,其实并不是之前的堆栈,而是一个新的堆栈、、这个问题我暂时没想到完美的方式把这个SIGNAL屏蔽掉,等后续观察再看,不影响主功能。 我下班后把这个问题解决一下,结合之前修复的几个小问题再发布一个小版本 感谢反馈~ |
不明觉厉,我说怎么有时候打印两个,一个或者不打印😂 |
fixed in CrashEye |
直接点击
Signal Crash
重新打开app没有发现crash日志,然后进入app再重新点击Exception Crash
才会把前面那个Signle
的日志打印出来The text was updated successfully, but these errors were encountered: