Relative Content

Tag Archive for androidexceptionjava-native-interfaceandroid-runtime

Impact on ART due to process termination from exception

I’m working on an Android app consisting of Kotlin (for the UI/UX) and C++ (app logic). I’m using JNI to bridge C++ to Kotlin. When a new thread is created, AttachCurrentThread is invoked to attach the thread to JVM and when app is about to quit, DetachCurrentThread is invoked before killing the thread.
In a normal scenario, there is no problem. But when an exception occurs, the signal/exception is trapped in the signal handler (same as Linux’s signal handler) or Kotlin’s Thread.UncaughtExceptionHandler, both will abruptly terminate the process (after logging some diagnostic info). So, there won’t be a chance to DetachCurrentThread from JVM (and perform other cleanup activities). According to this post, not invoking DetachCurrentThread can terminate the DVM.

Impact on ART due to process termination from exception

I’m working on an Android app consisting of Kotlin (for the UI/UX) and C++ (app logic). I’m using JNI to bridge C++ to Kotlin. When a new thread is created, AttachCurrentThread is invoked to attach the thread to JVM and when app is about to quit, DetachCurrentThread is invoked before killing the thread.
In a normal scenario, there is no problem. But when an exception occurs, the signal/exception is trapped in the signal handler (same as Linux’s signal handler) or Kotlin’s Thread.UncaughtExceptionHandler, both will abruptly terminate the process (after logging some diagnostic info). So, there won’t be a chance to DetachCurrentThread from JVM (and perform other cleanup activities). According to this post, not invoking DetachCurrentThread can terminate the DVM.

Impact on ART due to process termination from exception

I’m working on an Android app consisting of Kotlin (for the UI/UX) and C++ (app logic). I’m using JNI to bridge C++ to Kotlin. When a new thread is created, AttachCurrentThread is invoked to attach the thread to JVM and when app is about to quit, DetachCurrentThread is invoked before killing the thread.
In a normal scenario, there is no problem. But when an exception occurs, the signal/exception is trapped in the signal handler (same as Linux’s signal handler) or Kotlin’s Thread.UncaughtExceptionHandler, both will abruptly terminate the process (after logging some diagnostic info). So, there won’t be a chance to DetachCurrentThread from JVM (and perform other cleanup activities). According to this post, not invoking DetachCurrentThread can terminate the DVM.

Impact on ART due to process termination from exception

I’m working on an Android app consisting of Kotlin (for the UI/UX) and C++ (app logic). I’m using JNI to bridge C++ to Kotlin. When a new thread is created, AttachCurrentThread is invoked to attach the thread to JVM and when app is about to quit, DetachCurrentThread is invoked before killing the thread.
In a normal scenario, there is no problem. But when an exception occurs, the signal/exception is trapped in the signal handler (same as Linux’s signal handler) or Kotlin’s Thread.UncaughtExceptionHandler, both will abruptly terminate the process (after logging some diagnostic info). So, there won’t be a chance to DetachCurrentThread from JVM (and perform other cleanup activities). According to this post, not invoking DetachCurrentThread can terminate the DVM.

Impact on ART due to process termination from exception

I’m working on an Android app consisting of Kotlin (for the UI/UX) and C++ (app logic). I’m using JNI to bridge C++ to Kotlin. When a new thread is created, AttachCurrentThread is invoked to attach the thread to JVM and when app is about to quit, DetachCurrentThread is invoked before killing the thread.
In a normal scenario, there is no problem. But when an exception occurs, the signal/exception is trapped in the signal handler (same as Linux’s signal handler) or Kotlin’s Thread.UncaughtExceptionHandler, both will abruptly terminate the process (after logging some diagnostic info). So, there won’t be a chance to DetachCurrentThread from JVM (and perform other cleanup activities). According to this post, not invoking DetachCurrentThread can terminate the DVM.