Merge "Fix fault handler invoked before vm running."
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index 835485c..94753d4 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -177,6 +177,12 @@
Thread* self = Thread::Current();
+ // If ART is not running, or the thread is not attached to ART pass the
+ // signal on to the next handler in the chain.
+ if (self == nullptr || Runtime::Current() == nullptr || !Runtime::Current()->IsStarted()) {
+ InvokeUserSignalHandler(sig, info, context);
+ return;
+ }
// Now set up the nested signal handler.
// TODO: add SIGSEGV back to the nested signals when we can handle running out stack gracefully.