diff options
author | Josh Gao <jmgao@google.com> | 2016-10-10 21:31:02 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-10-10 21:31:02 +0000 |
commit | d3896c106d6a6e4d461be658a9e66efbde31f28d (patch) | |
tree | d297574f162b530f44644a05385a013e9b73166b /debuggerd/debuggerd.cpp | |
parent | 148b85b0501fcda6663f058985f1784b61d9049a (diff) | |
parent | 06928658c4a712924c7b18d3a5c892c0aafe537a (diff) |
Merge "debuggerd: report crashes even when out of file descriptors."
am: 06928658c4
Change-Id: I58cbd1f062c59b185b142c3c301221db8c98add5
Diffstat (limited to 'debuggerd/debuggerd.cpp')
-rw-r--r-- | debuggerd/debuggerd.cpp | 8 |
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. |