GithubHelp home page GithubHelp logo

Signal Crash about godeye HOT 15 CLOSED

zixun avatar zixun commented on June 23, 2024
Signal Crash

from godeye.

Comments (15)

zixun avatar zixun commented on June 23, 2024

感谢反馈。我刚刚试了3次,都能正常打印,能否提供更多细节

from godeye.

GLChan avatar GLChan commented on June 23, 2024

点击Singal Crash的 cell 导致崩溃之后,不能在Crash日志里面看到崩溃的信息,这个是原来就这样的还是?

from godeye.

zixun avatar zixun commented on June 23, 2024

原来就是可以正常打印=。=,我试了几次也能正常打印,好奇怪

from godeye.

GLChan avatar GLChan commented on June 23, 2024

我是直接下的源码跑真机的😂

from godeye.

zixun avatar zixun commented on June 23, 2024

对了,crash相关的你不能连着Xcode的debugger,Xcode的debugger优先级比较高,会导致crash监控被debugger吃掉😂

from godeye.

GLChan avatar GLChan commented on June 23, 2024

装完拔掉线重新打开app测试的,🤔

from godeye.

zixun avatar zixun commented on June 23, 2024

ConsoleController+Eye.swift文件中:

//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)
        })
    }
}

你用Log4G打印几条日志输出下CrashModel看

from godeye.

GLChan avatar GLChan commented on June 23, 2024

没发现有打印什么= =

from godeye.

GLChan avatar GLChan commented on June 23, 2024
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)
        })
        Log4G.log("😈CrashModel: \(model)")
    }
}

from godeye.

zixun avatar zixun commented on June 23, 2024

放在第一行:

func crashEyeDidCatchCrash(with model:CrashModel) {
        Log4G.log("😈CrashModel: \(model)")
        let model = CrashRecordModel(model: model)
        model.insertSync(complete: { [unowned self] (success:Bool) in
            self.addRecord(model: model)
        })
    }

因为系统在crash的时候留给app做处理的时间极短,而这边又需要将crash数据保存到数据库中,需要一些I/O,因此你放后面可能就执行不到了。。。

from godeye.

zixun avatar zixun commented on June 23, 2024

不过照你的说法Exception Crash后会把之前的Signle日志打印出来,至少能说明crash数据当时是正常保存的

from godeye.

GLChan avatar GLChan commented on June 23, 2024
  1. 刚刚重装试了一下只点击Exception Crash, 但是只出现了Signal的日志
  2. 清除所有打印日志,bug日志 之后再次尝试点击Signal Crash,没有打印出结果😈
  3. 再次清除所有日志,点击Exception Crash,有log日志😈,但是没有bug日志
    😂😂😂😂😂

from godeye.

zixun avatar zixun commented on June 23, 2024

找到原因了,在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屏蔽掉,等后续观察再看,不影响主功能。

我下班后把这个问题解决一下,结合之前修复的几个小问题再发布一个小版本

感谢反馈~

from godeye.

GLChan avatar GLChan commented on June 23, 2024

不明觉厉,我说怎么有时候打印两个,一个或者不打印😂

from godeye.

zixun avatar zixun commented on June 23, 2024

fixed in CrashEye

from godeye.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.