Coder Social home page Coder Social logo

关于demo anr演示 about signal HOT 1 OPEN

TestPlanB avatar TestPlanB commented on June 16, 2024
关于demo anr演示

from signal.

Comments (1)

lzhiyong avatar lzhiyong commented on June 16, 2024 1

ANR可以参考https://github.com/bugsnag/bugsnag-android 的实现.

SIGSEGV信号如果是主线程抛出的,是不会回调Java层的callNativeException方法(JVM阻止了这种调用),同时在信号处理函数中不能调用 non-async-signal-safe functions,但如果是子线程抛出这个信号,又可以回调到Java层,没有深入阅读过JVM的源码,所以不知道JVM是如何处理的

stackoverflow类似的问题https://stackoverflow.com/questions/54203717/callback-into-java-android-application-code-from-jni-after-catching-signal-sigs

因为大部分的代码肯定是在主线程中运行,所以是否应该在 Native 层直接创建一个子线程,或者使用AIDL的方式,用于监听和处理异常,回调Java层的方法.

from signal.

Related Issues (10)

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.