Commit graph

304 commits

Author SHA1 Message Date
Josh Gao
470df1b904 Merge "debuggerd: set the name of the signal sender." am: 3d0a87b
am: 437911e

* commit '437911ec87fe471a4cbe7e3dfa722e11d3187805':
  debuggerd: set the name of the signal sender.

Change-Id: I23723649fcc33a624f4aba80cde81f1bbb71fc3b
2016-03-30 19:15:39 +00:00
Josh Gao
f3dde2f869 debuggerd: set the name of the signal sender.
Change-Id: I6bff938e229d2368250d4b5c268fa24bd4badea0
2016-03-29 17:56:47 -07:00
Josh Gao
dac593937f debuggerd: add SIGSYS to the list of handled signals.
am: dfa163d

* commit 'dfa163df500ca71b71be315aa55e8859c946d0fb':
  debuggerd: add SIGSYS to the list of handled signals.
2016-03-26 01:16:25 +00:00
Josh Gao
dfa163df50 debuggerd: add SIGSYS to the list of handled signals.
Processes using seccomp will get SIGSYS when attempting to use a
disallowed syscall. We're currently not handling SIGSYS in bionic's
signal handler, but this change will let us dump a backtrace pointing at
rt_tgsigqueueinfo in our signal handler if seccomp policies block it
during a real crash.

Bug: http://b/27853687
Change-Id: I4e4aacc95eeef7249d895e19dc4ccd77a51c7a17
2016-03-25 14:34:22 -07:00
Josh Gao
6eb4eab106 debuggerd: waitpid for all children, and log the result.
Change-Id: Ic575e6db76ab153b4b238589a8cd299812d0e046
(cherry picked from commit 2808005521)
2016-03-23 14:28:01 -07:00
Josh Gao
a6219eae8d debuggerd: always send SIGCONT after detaching.
Bug: http://b/27330889
Change-Id: I104248af1cde03dbdbacc03c87fe7e2dffd6c037
(cherry picked from commit 24464185eb)
2016-03-23 14:27:57 -07:00
Josh Gao
8aeabe15dd Merge "debuggerd: waitpid for all children, and log the result." 2016-03-23 21:10:38 +00:00
Josh Gao
6e183586e3 Merge "debuggerd: always send SIGCONT after detaching." 2016-03-23 21:09:21 +00:00
Josh Gao
2808005521 debuggerd: waitpid for all children, and log the result.
Change-Id: Ic575e6db76ab153b4b238589a8cd299812d0e046
2016-03-23 14:07:58 -07:00
Josh Gao
24464185eb debuggerd: always send SIGCONT after detaching.
Bug: http://b/27330889
Change-Id: I104248af1cde03dbdbacc03c87fe7e2dffd6c037
2016-03-23 14:07:58 -07:00
Elliott Hughes
ae38923c3e Switch debuggerd over to unique_fd.
Change-Id: I858b9ac6a3ed47b4cc81cfe49f1ceb1e06356a03
2016-03-22 20:03:13 -07:00
Josh Gao
e59c76ab62 debuggerd: don't apply timeout when wait_for_gdb is on.
Change-Id: Ic632dde4a0510c212a4b1c01890df9a41e9771c9
(cherry picked from commit 676a756b7b)
2016-03-17 15:33:24 -07:00
Josh Gao
676a756b7b debuggerd: don't apply timeout when wait_for_gdb is on.
Change-Id: Ic632dde4a0510c212a4b1c01890df9a41e9771c9
2016-03-17 15:29:00 -07:00
Josh Gao
965d6f4d17 debuggerd: don't send SIGSTOP to crashing processes.
This was actually nonfunctional until f5e8f0b, because it was using kill
after privileges were dropped. This doesn't seem necessary after the
changes to the sibling thread ptrace logic, though.

Bug: http://b/27427439
Change-Id: I6bffbc14e0cf5e377bbfa39c945518e0d436c223
(cherry picked from commit b17f228ff6)
2016-03-17 14:15:01 -07:00
Josh Gao
b17f228ff6 debuggerd: don't send SIGSTOP to crashing processes.
This was actually nonfunctional until f5e8f0b, because it was using kill
after privileges were dropped. This doesn't seem necessary after the
changes to the sibling thread ptrace logic, though.

Bug: http://b/27427439
Change-Id: I6bffbc14e0cf5e377bbfa39c945518e0d436c223
2016-03-17 13:47:48 -07:00
Josh Gao
a951f4ca55 debuggerd: fix stupid typo.
Change-Id: Icd9a25a71e1e8580a200fe68bce0b17d09c51642
2016-03-17 13:23:41 -07:00
Josh Gao
1b301836bb debuggerd: fix stupid typo.
Change-Id: Icd9a25a71e1e8580a200fe68bce0b17d09c51642
2016-03-17 13:21:56 -07:00
Josh Gao
036ff2ce83 debuggerd: monitor the worker process for failure.
Use sigtimedwait on SIGCHLD to watch our forked worker processes for
failure, so that we can guarantee that we always resume/kill the target
process if libunwind crashes.

Bug: http://b/27427439
Change-Id: I5a5da1f1abd7dc9d01223f5b3778e946e2d47d20
(cherry picked from commit 630bc80e18)
2016-03-17 13:11:08 -07:00
Josh Gao
e5dbdd09c7 debuggerd: fork the signal sender once.
Bug: http://b/27427439
Change-Id: I6294ff68a150bc9950a300264c31d2141307ac66
(cherry picked from commit f5e8f0b9cd)
2016-03-17 13:11:05 -07:00
Elliott Hughes
1a69e2811e Clean up CLOEXEC in debuggerd.
Change-Id: I1cd75f6a8f98e99f4a4fedfc706103ce34035765
(cherry picked from commit 17ba68d0cd)
2016-03-17 13:11:01 -07:00
Elliott Hughes
aa41756851 Remove dead code from debuggerd.
system/core/debuggerd/debuggerd.cpp:683:5: warning: Value stored to 'logsocket' is never read
    logsocket = -1;
    ^           ~~

Bug: http://b/27264392
Change-Id: I8eab8a02b67f219c32aea49e4d4957e5642df38f
(cherry picked from commit 6da1353863)
2016-03-17 13:10:58 -07:00
Josh Gao
630bc80e18 debuggerd: monitor the worker process for failure.
Use sigtimedwait on SIGCHLD to watch our forked worker processes for
failure, so that we can guarantee that we always resume/kill the target
process if libunwind crashes.

Bug: http://b/27427439
Change-Id: I5a5da1f1abd7dc9d01223f5b3778e946e2d47d20
2016-03-17 11:43:55 -07:00
Josh Gao
f5e8f0b9cd debuggerd: fork the signal sender once.
Bug: http://b/27427439
Change-Id: I6294ff68a150bc9950a300264c31d2141307ac66
2016-03-17 11:27:31 -07:00
Josh Gao
bcb58e6d64 debuggerd: kill crashing processes with the signal they died with.
Bug: http://b/27675306
Change-Id: I951c5d7e54c35d88c65c5dc856e0b9d5a93d47b2
(cherry picked from commit 561497c0a8)
2016-03-16 16:16:41 -07:00
Josh Gao
561497c0a8 debuggerd: kill crashing processes with the signal they died with.
Bug: http://b/27675306
Change-Id: I951c5d7e54c35d88c65c5dc856e0b9d5a93d47b2
2016-03-16 16:10:48 -07:00
Josh Gao
48972c80d9 Merge "debuggerd: make sure that we kill the process after dumping." into nyc-dev 2016-03-10 22:32:34 +00:00
Christopher Ferris
c463ba45c4 Add error reporting mechanism for failing Unwind.
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.

Bug: 27449879

(cherry picked from commit 206a3b9798)

Change-Id: If9e7cfeb6eb7b122679a734c1a9eacee8354ef18
2016-03-10 14:14:43 -08:00
Christopher Ferris
3f9c22c34c Merge "Add error reporting mechanism for failing Unwind." 2016-03-10 22:12:35 +00:00
Christopher Ferris
206a3b9798 Add error reporting mechanism for failing Unwind.
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.

Bug: 27449879
Change-Id: Ie81718d53fb0e519fa0a7db9fd5f314b72bfa431
2016-03-10 12:39:15 -08:00
Josh Gao
c6348f4e7f debuggerd: make sure that we kill the process after dumping.
Bug: http://b/27367422
Change-Id: Icd704b1effd558904975cfc524714b51917a653f
(cherry picked from commit f0c8723bdd)
2016-03-09 16:23:44 -08:00
Josh Gao
f0c8723bdd debuggerd: make sure that we kill the process after dumping.
Bug: http://b/27367422
Change-Id: Icd704b1effd558904975cfc524714b51917a653f
2016-03-09 15:59:27 -08:00
Elliott Hughes
dbab798695 Merge "Clean up CLOEXEC in debuggerd."
am: f405d245eb

* commit 'f405d245eb1288c8085cfdeaa3e02b4af707c4f1':
  Clean up CLOEXEC in debuggerd.
2016-02-23 18:46:21 +00:00
Elliott Hughes
17ba68d0cd Clean up CLOEXEC in debuggerd.
Change-Id: I1cd75f6a8f98e99f4a4fedfc706103ce34035765
2016-02-19 18:13:02 -08:00
Elliott Hughes
bdf9d18c34 Merge "Remove dead code from debuggerd."
am: fbaefc4d9d

* commit 'fbaefc4d9d4e7e40ec0262123cd54762b81ed47a':
  Remove dead code from debuggerd.
2016-02-19 19:42:29 +00:00
Elliott Hughes
fbaefc4d9d Merge "Remove dead code from debuggerd." 2016-02-19 19:36:22 +00:00
Elliott Hughes
6da1353863 Remove dead code from debuggerd.
system/core/debuggerd/debuggerd.cpp:683:5: warning: Value stored to 'logsocket' is never read
    logsocket = -1;
    ^           ~~

Bug: http://b/27264392
Change-Id: I8eab8a02b67f219c32aea49e4d4957e5642df38f
2016-02-19 10:41:17 -08:00
James Hawkins
0f5d443d0c Merge "system/core: Cleanup direct calls to opendir by containing in a std::unique_ptr."
am: bd04bb0d29

* commit 'bd04bb0d297c1a7cd5aabdc258b1829905fb067d':
  system/core: Cleanup direct calls to opendir by containing in a std::unique_ptr.
2016-02-19 17:51:44 +00:00
James Hawkins
588a2cad7f system/core: Cleanup direct calls to opendir by containing in a
std::unique_ptr.

Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -08:00
Bill Yi
4409f1446c Merge commit '4352ee87fd74b931d4b58192fb8974e91aa899d0' into HEAD 2016-02-17 11:37:00 -08:00
Christopher Ferris
840887053c Merge "Newer kernels added SEGV_BNDERR."
am: 14c06e0769

* commit '14c06e0769817d81f18fcdc41132747ffc158745':
  Newer kernels added SEGV_BNDERR.
2016-02-05 02:20:13 +00:00
Christopher Ferris
5d56e28537 Newer kernels added SEGV_BNDERR.
Bug: 23789423
Change-Id: I6fdce75715edfce179df8c0e6a7205f26341ebd0
2016-02-04 14:07:23 -08:00
Elliott Hughes
1ef5b78a2f Merge "Start debuggerd as soon as logd is up."
am: 1b729b3e04

* commit '1b729b3e04b210d096ee2d447945f6b2c53b6029':
  Start debuggerd as soon as logd is up.
2016-02-02 21:10:47 +00:00
Elliott Hughes
2f74a5dae5 Start debuggerd as soon as logd is up.
Makes debugging early boot crashes easier.

Bug: http://b/26918597
Change-Id: I5bb883f1350ea5f7a545cb0e9f1034ecfcf47cdb
2016-02-02 13:03:41 -08:00
Josh Gao
f983e6ce5a Merge "debuggerd: fix debug.debuggerd.wait_for_gdb."
am: a590596dca

* commit 'a590596dcac8cc6a2ffaab110bdd89fdb5f837d8':
  debuggerd: fix debug.debuggerd.wait_for_gdb.
2016-01-15 19:40:49 +00:00
Josh Gao
2318cc0155 Merge "debuggerd: fix several bugs caused by fork/setuid change."
am: 1bf7000033

* commit '1bf700003368e8b68b34a0f9968ae5afd25dd4f2':
  debuggerd: fix several bugs caused by fork/setuid change.
2016-01-15 19:40:41 +00:00
Josh Gao
c362c45949 debuggerd: fix debug.debuggerd.wait_for_gdb.
Bug: http://b/26513486
Change-Id: I01c28ce810a49f8a4e0e2a86c7d018d95f9617c8
2016-01-15 11:31:17 -08:00
Josh Gao
7c89f9e955 debuggerd: fix several bugs caused by fork/setuid change.
Previously, we weren't PTRACE_ATTACHing to all of the threads of a
process, and we were also trying to do it after forking and dropping
privileges. This patch ensures that all ptrace attaching/detaching
happens in one place, before forking/exiting respectively.

Bug: http://b/26443860
Bug: http://b/26436605
Bug: http://b/26436486
Change-Id: Id94e0c1d9d56c051d0dd281d895aaa3285079198
2016-01-14 15:06:37 -08:00
Colin Cross
ce93dd6fcc Merge "debuggerd_test: provide stub selinux/android.h"
am: 5e19382e1c

* commit '5e19382e1c585967ee07b14fbb36a8027c92c394':
  debuggerd_test: provide stub selinux/android.h
2016-01-08 20:54:20 +00:00
Colin Cross
5e19382e1c Merge "debuggerd_test: provide stub selinux/android.h" 2016-01-08 20:49:47 +00:00
Dan Willemsen
3be0a0df2c Merge "Turn off -Wdate-time for crasher"
am: 392867cff1

* commit '392867cff1584f2ee475aae4b8f89778085a7de0':
  Turn off -Wdate-time for crasher
2016-01-06 00:35:00 +00:00