summaryrefslogtreecommitdiff
path: root/debuggerd/debuggerd.cpp
AgeCommit message (Collapse)Author
2018-06-14debuggerd: add support for Java traces.Josh Gao
Test: `debuggerd -j $(pidof com.android.settings)` Change-Id: I051c9b6d313e5350416b3d0743c3fc75f43fbd0c
2017-07-01Remove unnecessary SELinux dependenciesNick Kralevich
These are unused. Test: code compiles. Change-Id: Idd707dfcc8f6daac3a489c791ecc364841cf31f9
2017-06-27debuggerd: diagnostics for dumps that are guaranteed to fail.Josh Gao
Print diagnostics when the user requests a dump that is guaranteed to fail, such as trying to dump a process you can't send a signal to. Bug: http://b/63008395 Change-Id: I5c6bf2a5751f858e0534990b8d2ab6932eb9f11d Test: manually tested
2017-05-31tombstoned: allow intercepts for java traces.Narayan Kamath
All intercept requests and crash dump requests must now specify a dump_type, which can be one of kDebuggerdNativeBacktrace, kDebuggerdTombstone or kDebuggerdJavaBacktrace. Each process can have only one outstanding intercept registered at a time. There's only one non-trivial change in this changeset; and that is to crash_dump. We now pass the type of dump via a command line argument instead of inferring it from the (resent) signal, this allows us to connect to tombstoned before we wait for the signal as the protocol requires. Test: debuggerd_test Change-Id: I189b215acfecd08ac52ab29117e3465da00e3a37
2017-05-22tombstoned: Add a shared library version of libtombstoned_client...Narayan Kamath
.. for ART and the frameworks to link against. In the new stack dumping scheme (see related bug), the Java runtime will communicate with tombstoned in order to obtain a FD to which it can write its traces. Also move things around to separate headers that are private implementation details from headers that constitute the public debuggerd API. There are currently only three such headers : - tombstoned/tombstoned.h - debuggerd/client.h - debuggerd/handler.h Bug: 32064548 Test: make Change-Id: If1b8578550e373d84828b180bbe585f1088d1aa3
2017-03-02Small debuggerd improvements.Elliott Hughes
Include the ABI in seccomp causes. Slightly improved command-line usage information. Fix crasher for seccomp failures. Bug: N/A Test: crasher Change-Id: Ie419ecfe72ee4f5ccf49c927be18350a58a66a90
2017-01-30debuggerd: fix `debuggerd <pid>`Josh Gao
Bug: none Test: `debuggerd mediaserver` Change-Id: Ibd7bbddb92a99ce49622c0ecc9329a3723f2085d
2017-01-17debuggerd: advance our amazing bet.Josh Gao
Remove debuggerd in favor of a helper process that gets execed by crashing processes. Bug: http://b/30705528 Test: debuggerd_test Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
2017-01-11liblog: use log/log.h when utilizing ALOG macrosMark Salyzyn
Test: compile Bug: 30465923 Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2016-11-30Merge "debuggerd: Dump list of open files on process crash."Richard Uhler
am: b675f7cd32 Change-Id: Iec231fc7eb57fa2c51aabc0fb75b4a09c47004cd
2016-11-21debuggerd: Dump list of open files on process crash.Richard Uhler
Test: Open a bunch of files, wait for the process to crash, verify dubuggerd includes the list of open files the tombstone it generates. Test: Added OpenFilesListTest to debuggerd_test. Bug: 32013594 Change-Id: I6f939ae1d04dc58dc99abff0ed930da9e0ef0d1c
2016-10-20Merge "system/core: preparation to pull back interfaces from android/log.h"Mark Salyzyn
am: 27d2d49f48 Change-Id: I604bb1d4cf62636663fa92e3d14a55887dbcae23
2016-10-20system/core: preparation to pull back interfaces from android/log.hMark Salyzyn
Point to log/log.h where necessary, define LOG_TAG where necessary. Accept that private/android_logger.h is suitable replacement for log/logger.h and android/log.h. Correct liblog/README Effectively a cleanup and controlled select revert of 'system/core: drop or replace log/logger.h' and 'system/core: Replace log/log.h with android/log.h'. Test: compile Bug: 30465923 Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-10Merge commit 'd3896c106d6a6e4d461be658a9e66efbde31f28d' into nyc-dev-plus-aospJosh Gao
Change-Id: I77d77be5ba21c55cdf1172d7a7f7b4ba04dcbc81
2016-10-07debuggerd: report crashes even when out of file descriptors.Josh Gao
Use nasty clone hacks to let us close random file descriptors to be able to connect to debuggerd when the fd table is full. Bug: http://b/32013594 Test: crasher exhaustfd-SIGSEGV Change-Id: I47772e9a5994da4473bd935b105d9c36827c017a
2016-10-04Merge "system/core: drop or replace log/logger.h" am: 1f90485804Mark Salyzyn
am: cb670780be Change-Id: I532a0f6143511f53f3303751f95de115ac034cd7
2016-10-04system/core: drop or replace log/logger.hMark Salyzyn
debuggerd does not require log/logger.h, can use android/log.h In some cases, mark why log/logger.h was required. Test: Compile and boot smoke test Bug: 26552300 Bug: 31289077 Bug: 31456426 Change-Id: Ia34987e25a01d81971ec8d785415f732b8376c4f
2016-09-16Merge "Fix debuggerd argument parsing." am: 99ed65234cElliott Hughes
am: 014d9df418 Change-Id: I2565eb9a4b631e51bfe6bd57d328c8cdd2c3eff6
2016-09-15Fix debuggerd argument parsing.Elliott Hughes
We weren't detecting incorrect input before. Also clean up the help output to match the style of all the toybox output. Also flush stdout so that we don't report failure before even saying that we're going to try to contact debuggerd... Change-Id: I9e4bfa878f270fe46c3c210c7a7138959a108d67
2016-08-23Merge "Most accept/accept4 calls in system/core don't actually want the ↵Elliott Hughes
remote address." am: 299d64144b am: 8615d79d85 Change-Id: I89aeabf6efa8217c9acd3f8a766bbd18f7e994fa
2016-08-23Merge "Most accept/accept4 calls in system/core don't actually want the ↵Elliott Hughes
remote address." am: 299d64144b Change-Id: I3fb9678dfed08f0b1d6e90e547ecae6cdcabc9a1
2016-08-23Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later." am: 82b67fff06Elliott Hughes
am: 0d2ef3dc86 Change-Id: Ie8ae5707455f4d1741ca87ef515ea9a142e05aa5
2016-08-23Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later."Elliott Hughes
am: 82b67fff06 Change-Id: I6f2e72a4847fbfac8e1ba78321be7e026f7629bd
2016-08-23Most accept/accept4 calls in system/core don't actually want the remote address.Elliott Hughes
So don't write the extra code for it or waste the kernel's time copying it around. Change-Id: I93de64064c2d4fe58ba5b5322cfa69bf31a76dad
2016-08-22debuggerd: set SOCK_NONBLOCK in accept rather than later.Elliott Hughes
Change-Id: I95586984dd7aec798d75b150be238d5f6f7c91da
2016-08-13Merge "debuggerd: remove unnecessary arguments." am: 7a746f3a68Josh Gao
am: 60083bed75 Change-Id: I6f575a9662319db0dffeb121e0400eaa8f8cee55
2016-08-13Merge "debuggerd: remove unnecessary arguments."Josh Gao
am: 7a746f3a68 Change-Id: I0a01639dd3096372eb5bbbe28362cdbf1c1da4af
2016-08-12Merge "debuggerd: remove useless timeout from wait_for_signal." am: 5f2bc28ebfJosh Gao
am: 4c4a172ee9 Change-Id: Ibbf4ff52d9349e8ceee5a6550c997328b204f332
2016-08-12Merge "debuggerd: remove useless timeout from wait_for_signal."Josh Gao
am: 5f2bc28ebf Change-Id: Iee4f22c04ad330c91f86ca03583f8e36b2816039
2016-08-12debuggerd: remove unnecessary arguments.Josh Gao
These were previously required when bionic used tgkill to reraise signals, but now that we use rt_tgsigqueueinfo to reraise signals, they are no longer necessary. Change-Id: I46ba9f14039a727d0a2c4c3a9d93a3532ba8f263
2016-08-12debuggerd: remove useless timeout from wait_for_signal.Josh Gao
The watchdog already handles things for us, so the timeout logic in wait_for_signal is pointless. Change-Id: Id81ad5f294068216b73e04c4e2ceca072ae1bbc0
2016-07-19Merge \"debuggerd: verify that traced threads belong to the right process.\" ↵Josh Gao
into nyc-dev am: d3d04f4d72 Change-Id: I65cd7507a24b7148dd67d748dede8e664dd70328
2016-07-13debuggerd: verify that traced threads belong to the right process.Josh Gao
Fix two races in debuggerd's PTRACE_ATTACH logic: 1. The target thread in a crash dump request could exit between the /proc/<pid>/task/<tid> check and the PTRACE_ATTACH. 2. Sibling threads could exit between listing /proc/<pid>/task and the PTRACE_ATTACH. Bug: http://b/29555636 Change-Id: I4dfe1ea30e2c211d2389321bd66e3684dd757591
2016-06-20Merge changes from topic \'debuggerd_client\'Josh Gao
am: abf88685e3 Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-17debuggerd: add libdebuggerd_client.Josh Gao
Bug: http://b/24414818 Change-Id: I079c534d2c952b6975bf0428eb86cc7a55525737
2016-05-05Set groups before dropping privileges.Christopher Ferris
The code for dumping tombstones tries to read the log data. This was silently failing after the change to drop root privileges. Fix this by explicitly setting the groups allowed before dropping privileges. Bug: 28590884 (cherry picked from commit edc23801091f1a909efe130e0dba8abab3329eb5) Change-Id: I225365edccb11f8752027566fd42f3b10ce10260
2016-05-05Merge "Set groups before dropping privileges." into nyc-devChristopher Ferris
am: fd1eee58f9 * commit 'fd1eee58f985b3d528ca352ff278d7b200390ab2': Set groups before dropping privileges. Change-Id: I85c98abb0e7cc3b36ec714899540d65e6ca908c7
2016-05-05Set groups before dropping privileges.Christopher Ferris
The code for dumping tombstones tries to read the log data. This was silently failing after the change to drop root privileges. Fix this by explicitly setting the groups allowed before dropping privileges. Bug: 28590884 Change-Id: Iaccb1d2928268fc9fc855f6e3814c31ce019badf
2016-05-05Merge "Fix problem with wait_for_gdb." into nyc-devChristopher Ferris
am: a7431cfa57 * commit 'a7431cfa570c6385ecd2041d56ead2603d7b7b80': Fix problem with wait_for_gdb. Change-Id: I6d995c423f4ad9134965a215b1eea4cc7fd338b9
2016-05-05Fix problem with wait_for_gdb.Christopher Ferris
When someone enables wait_for_gdb, activity manager will kill the stopped process before a developer can attach to the process. To allow debugging in this case, change the code to only contact the activity manager right before continuing the process that is crashing. Also, modify the conditions under which to do a gdb attach. The previous code did a partial attach if perform_dump failed. The new version simply allows an attach regardless of whether perform_dump passes or fails. Bug: 28409358 (cherry picked from commit 9818bd2bbee00c387247210eeae2a0a0d3912c8b) Change-Id: I42f464b69332748e16b07d9d00f44b3aa26ce8b7
2016-05-04Fix problem with wait_for_gdb.Christopher Ferris
When someone enables wait_for_gdb, activity manager will kill the stopped process before a developer can attach to the process. To allow debugging in this case, change the code to only contact the activity manager right before continuing the process that is crashing. Also, modify the conditions under which to do a gdb attach. The previous code did a partial attach if perform_dump failed. The new version simply allows an attach regardless of whether perform_dump passes or fails. Bug: 28409358 Change-Id: I4fe8d390c212d47e007cbe6543c2d114c3c7aeff
2016-04-20Connect to activity manager as root.Christopher Ferris
am: 0fc89f3 * commit '0fc89f34b99f20f0ebc0111df74490f4ebd44076': Connect to activity manager as root. Change-Id: I28ad7d209d6d94be790bd4ffd1e5b31da4cd8589
2016-04-20Connect to activity manager as root.Christopher Ferris
Before dropping root privileges, connect to the activity manager. Also, only connect to the activity manager if this is a crash. Bug: 28210681 (cherry picked from commit 0fc89f34b99f20f0ebc0111df74490f4ebd44076) Change-Id: Id25b92e550d71ffe1b9eafe43976ef514a83714b
2016-04-20Connect to activity manager as root.Christopher Ferris
Before dropping root privileges, connect to the activity manager. Also, only connect to the activity manager if this is a crash. Bug: 28210681 Change-Id: Ie266031910519fa2aa6835644a95c1fc56e24d8d
2016-03-26debuggerd: add SIGSYS to the list of handled signals.Josh Gao
am: dfa163d * commit 'dfa163df500ca71b71be315aa55e8859c946d0fb': debuggerd: add SIGSYS to the list of handled signals.
2016-03-25debuggerd: add SIGSYS to the list of handled signals.Josh Gao
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-23debuggerd: waitpid for all children, and log the result.Josh Gao
Change-Id: Ic575e6db76ab153b4b238589a8cd299812d0e046 (cherry picked from commit 280800552165b4685fbe86fd8e9dc3b9d9b062cb)
2016-03-23debuggerd: always send SIGCONT after detaching.Josh Gao
Bug: http://b/27330889 Change-Id: I104248af1cde03dbdbacc03c87fe7e2dffd6c037 (cherry picked from commit 24464185eb260b4af577895e1c2d35b734a7f99b)
2016-03-23Merge "debuggerd: waitpid for all children, and log the result."Josh Gao
2016-03-23Merge "debuggerd: always send SIGCONT after detaching."Josh Gao