summaryrefslogtreecommitdiff
path: root/debuggerd/debuggerd.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2016-10-10 21:22:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-10-10 21:22:27 +0000
commit06928658c4a712924c7b18d3a5c892c0aafe537a (patch)
tree3e9f9053000fe21945e35512999d7da22eb22ed0 /debuggerd/debuggerd.cpp
parent5bc3ce85cf033accbc2280581ca141e68d6dc5f0 (diff)
parent218f7fb68e219884f6eec9714afb4da691450bc5 (diff)
Merge "debuggerd: report crashes even when out of file descriptors."
Diffstat (limited to 'debuggerd/debuggerd.cpp')
-rw-r--r--debuggerd/debuggerd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index a6d3d382e..b8a62a583 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -69,6 +69,7 @@ struct debugger_request_t {
debugger_action_t action;
pid_t pid, tid;
uid_t uid, gid;
+ pid_t ignore_tid;
uintptr_t abort_msg_address;
};
@@ -215,6 +216,7 @@ static int read_request(int fd, debugger_request_t* out_request) {
out_request->action = static_cast<debugger_action_t>(msg.action);
out_request->tid = msg.tid;
+ out_request->ignore_tid = msg.ignore_tid;
out_request->pid = cr.pid;
out_request->uid = cr.uid;
out_request->gid = cr.gid;
@@ -408,7 +410,7 @@ static void redirect_to_32(int fd, debugger_request_t* request) {
}
#endif
-static void ptrace_siblings(pid_t pid, pid_t main_tid, std::set<pid_t>& tids) {
+static void ptrace_siblings(pid_t pid, pid_t main_tid, pid_t ignore_tid, std::set<pid_t>& tids) {
char task_path[64];
snprintf(task_path, sizeof(task_path), "/proc/%d/task", pid);
@@ -434,7 +436,7 @@ static void ptrace_siblings(pid_t pid, pid_t main_tid, std::set<pid_t>& tids) {
continue;
}
- if (tid == main_tid) {
+ if (tid == main_tid || tid == ignore_tid) {
continue;
}
@@ -583,7 +585,7 @@ static void worker_process(int fd, debugger_request_t& request) {
std::set<pid_t> siblings;
if (!attach_gdb) {
- ptrace_siblings(request.pid, request.tid, siblings);
+ ptrace_siblings(request.pid, request.tid, request.ignore_tid, siblings);
}
// Generate the backtrace map before dropping privileges.