summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dave Allison <dallison@google.com> 2014-09-04 21:59:58 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-09-04 21:59:59 +0000
commited20a4d80bcd8d47b5bcdd51ef17c786c0e5015c (patch)
tree928cadcdceb8c17ee9284a8d055390d0bc8cdf46
parent0e59bf8b767e9be7ea22c67011ea902d597fe43f (diff)
parent8be44cf31e76465090d717ccadcabeb079e03f5e (diff)
Merge "Fix arm64 build warning (promoted to error)."
-rw-r--r--runtime/fault_handler.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index cc1038cb62..47696f9bd0 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -186,8 +186,6 @@ void FaultManager::HandleFault(int sig, siginfo_t* info, void* context) {
action.sa_restorer = nullptr;
#endif
- bool signal_handled = false;
-
// Catch SIGSEGV and SIGABRT to invoke our nested handler
int e1 = sigaction(SIGSEGV, &action, &oldsegvaction);
int e2 = sigaction(SIGABRT, &action, &oldabortaction);
@@ -200,8 +198,12 @@ void FaultManager::HandleFault(int sig, siginfo_t* info, void* context) {
if (setjmp(*self->GetNestedSignalState()) == 0) {
for (const auto& handler : other_handlers_) {
if (handler->Action(sig, info, context)) {
- signal_handled = true;
- break;
+ // Restore the signal handlers, reinit the fault manager and return. Signal was
+ // handled.
+ sigaction(SIGSEGV, &oldsegvaction, nullptr);
+ sigaction(SIGABRT, &oldabortaction, nullptr);
+ fault_manager.Init();
+ return;
}
}
} else {
@@ -216,13 +218,11 @@ void FaultManager::HandleFault(int sig, siginfo_t* info, void* context) {
// Now put the fault manager back in place.
fault_manager.Init();
- if (!signal_handled) {
- // Set a breakpoint in this function to catch unhandled signals.
- art_sigsegv_fault();
+ // Set a breakpoint in this function to catch unhandled signals.
+ art_sigsegv_fault();
- // Pass this on to the next handler in the chain, or the default if none.
- InvokeUserSignalHandler(sig, info, context);
- }
+ // Pass this on to the next handler in the chain, or the default if none.
+ InvokeUserSignalHandler(sig, info, context);
}
void FaultManager::AddHandler(FaultHandler* handler, bool generated_code) {