summaryrefslogtreecommitdiffstats
path: root/runtime/fault_handler.cc
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-11-18 15:50:47 -0800
committerChristopher Ferris <cferris@google.com>2014-11-20 15:47:29 -0800
commit5e2b8747df8eabdd0daf091f1afe3b7b3d6c2719 (patch)
tree4a24eef9397d422be230e08881c37783a796eb2f /runtime/fault_handler.cc
parenta971100be7870544360fa8a46311ef7f5adb6902 (diff)
downloadart-5e2b8747df8eabdd0daf091f1afe3b7b3d6c2719.zip
art-5e2b8747df8eabdd0daf091f1afe3b7b3d6c2719.tar.gz
art-5e2b8747df8eabdd0daf091f1afe3b7b3d6c2719.tar.bz2
Fix fault handler invoked before vm running.
If the ART fault handler is invoked before the vm is running, the code derefences a NULL pointer. In this case, just invoke the next handler in the chain instead. Change-Id: I58f0493eae1825d7a92a1e052c88e80527914dba
Diffstat (limited to 'runtime/fault_handler.cc')
-rw-r--r--runtime/fault_handler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index ab3ec62..65844a5 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -177,6 +177,12 @@ void FaultManager::HandleFault(int sig, siginfo_t* info, void* context) {
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.