summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2017-06-01 11:55:25 -0700
committerJosh Gao <jmgao@google.com>2017-06-01 16:25:39 -0700
commit615d9399743fcbeec222a1a5b6f63ed159d20263 (patch)
tree7ddf5be469784e182f7f06a4a996a289be92ee64
parent8ecf59439ca2ffa444ab55f76efabb41db9dfddf (diff)
downloadcore-615d9399743fcbeec222a1a5b6f63ed159d20263.tar.gz
crash_dump: clear the signal mask.
crash_dump inherits its signal mask from the thread that forked it, which always has all of its signals blocked, now that sigchain respects sa_mask. Manually clear the signal mask, and reduce the timeout to a still-generous 2 seconds. Bug: http://b/38427757 Test: manually inserted sleep in crash_dump Merged-In: If1c9adb68777b71fb19d9b0f47d6998733ed8f52 Change-Id: If1c9adb68777b71fb19d9b0f47d6998733ed8f52 (cherry picked from commit e740250b9d966c7eb9a7959a47526906780d7715)
-rw-r--r--debuggerd/crash_dump.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/debuggerd/crash_dump.cpp b/debuggerd/crash_dump.cpp
index 88f390b0e..1027f69cd 100644
--- a/debuggerd/crash_dump.cpp
+++ b/debuggerd/crash_dump.cpp
@@ -212,6 +212,12 @@ int main(int argc, char** argv) {
return 1;
}
+ sigset_t mask;
+ sigemptyset(&mask);
+ if (sigprocmask(SIG_SETMASK, &mask, nullptr) != 0) {
+ PLOG(FATAL) << "failed to set signal mask";
+ }
+
pid_t main_tid;
pid_t pseudothread_tid;
@@ -259,7 +265,7 @@ int main(int argc, char** argv) {
}
// Die if we take too long.
- alarm(20);
+ alarm(2);
std::string attach_error;