diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-04 13:40:17 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-03-04 13:48:25 -0800 |
commit | 28c8359c4e9d01ee09dc73409070b7f2223d670f (patch) | |
tree | 33addd09ac4d5fc2b45265d32262b7d5e5a1ef12 /runtime/runtime_android.cc | |
parent | b02458f842a1263e6a7b3107d819a97a37fec726 (diff) | |
download | art-28c8359c4e9d01ee09dc73409070b7f2223d670f.zip art-28c8359c4e9d01ee09dc73409070b7f2223d670f.tar.gz art-28c8359c4e9d01ee09dc73409070b7f2223d670f.tar.bz2 |
Disable new signal handler.
Doesn't play well with existing signal handlers.
Change-Id: Ic93691ad8af14f037bec571a2163bae146741d31
Diffstat (limited to 'runtime/runtime_android.cc')
-rw-r--r-- | runtime/runtime_android.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/runtime/runtime_android.cc b/runtime/runtime_android.cc index a237722..079d7e5 100644 --- a/runtime/runtime_android.cc +++ b/runtime/runtime_android.cc @@ -28,6 +28,7 @@ namespace art { static constexpr bool kDumpHeapObjectOnSigsevg = false; +static constexpr bool kUseSignalHandler = false; struct sigaction old_action; void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void* raw_context) { @@ -56,18 +57,19 @@ void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void* raw_contex } void Runtime::InitPlatformSignalHandlers() { - // On the host, we don't have debuggerd to dump a stack for us when something unexpected happens. - struct sigaction action; - memset(&action, 0, sizeof(action)); - sigemptyset(&action.sa_mask); - action.sa_sigaction = HandleUnexpectedSignal; - // Use the three-argument sa_sigaction handler. - action.sa_flags |= SA_SIGINFO; - // Use the alternate signal stack so we can catch stack overflows. - action.sa_flags |= SA_ONSTACK; - int rc = 0; - rc += sigaction(SIGSEGV, &action, &old_action); - CHECK_EQ(rc, 0); + if (kUseSignalHandler) { + struct sigaction action; + memset(&action, 0, sizeof(action)); + sigemptyset(&action.sa_mask); + action.sa_sigaction = HandleUnexpectedSignal; + // Use the three-argument sa_sigaction handler. + action.sa_flags |= SA_SIGINFO; + // Use the alternate signal stack so we can catch stack overflows. + action.sa_flags |= SA_ONSTACK; + int rc = 0; + rc += sigaction(SIGSEGV, &action, &old_action); + CHECK_EQ(rc, 0); + } } } // namespace art |