summaryrefslogtreecommitdiffstats
path: root/debuggerd
Commit message (Collapse)AuthorAgeFilesLines
* Merge "debuggerd_test: provide stub selinux/android.h"Colin Cross2016-01-081-0/+17
|\
| * debuggerd_test: provide stub selinux/android.hColin Cross2015-12-211-0/+17
| | | | | | | | | | | | | | | | | | debuggerd_test stubs out the selinux/android.h interface, but was relying on copied selinux headers to declare the interface. Create a stub selinux/android.h header included by the test to declare the interface. Change-Id: I6a2d402dda1797deb2515f10b663b1a84d498eac
* | Merge "Turn off -Wdate-time for crasher"Dan Willemsen2016-01-061-1/+1
|\ \
| * | Turn off -Wdate-time for crasherDan Willemsen2015-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is an optional diagnostic tool where it's useful to know if you are running the version that you just built. Allow the use of __TIME__ without a warning or error. Bug: 24204119 Change-Id: I78063c2694b80ccaf5891d1cd649ea17eda978cb
* | | debuggerd: fork and drop privileges when dumping.Josh Gao2016-01-053-89/+116
| |/ |/| | | | | | | Bug: http://b/25195825 Change-Id: I913d8425232e79df3f7a051a8cc63de9c60f4780
* | Merge "Switch from using sockaddr to sockaddr_storage."Erik Kline2015-12-081-3/+4
|\ \
| * | Switch from using sockaddr to sockaddr_storage.Erik Kline2015-12-071-3/+4
| | | | | | | | | | | | | | | | | | This is to ensure sufficient space is always available. Change-Id: Ifa87b93ecdc90dcacbfb24446c872344da6703d3
* | | Track rename of base/ to android-base/.Elliott Hughes2015-12-046-7/+7
|/ / | | | | | | Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
* | debuggerd: remove some levels of indentation.Josh Gao2015-11-171-136/+123
| | | | | | | | | | | | | | Use ScopedFd and unique_ptr to manage resources, so that we can early exit instead of having 9 levels of indentation. Change-Id: Ia5fed76c7d959f1f198ea540c56c508f7e1585c4
* | debuggerd: add .clang-format.Josh Gao2015-11-161-0/+15
| | | | | | | | Change-Id: I3584c170aadc3707638e407c7a8ca502f3670058
* | Enable hidepid=2 on /procNick Kralevich2015-11-092-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following mount options to the /proc filesystem: hidepid=2,gid=3009 This change blocks /proc access unless you're in group 3009 (aka AID_READPROC). Please see https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt for documentation on the hidepid option. hidepid=2 is preferred over hidepid=1 since it leaks less information and doesn't generate SELinux ptrace denials when trying to access /proc without being in the proper group. Add AID_READPROC to processes which need to access /proc entries for other UIDs. Bug: 23310674 Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
* | Merge "Remove __DATE__/__TIME__ from init and debuggerd"Dan Willemsen2015-10-221-1/+1
|\| | | | | | | | | | | | | am: 512b0e60b4 * commit '512b0e60b4fb33ec5535c1784a99a27539787790': Remove __DATE__/__TIME__ from init and debuggerd
| * Remove __DATE__/__TIME__ from init and debuggerdDan Willemsen2015-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Keeping these means that every build has different init and debuggerd binaries, even if the source was the same. So OTAs that don't touch these sources would still need to update the binaries. Both of these messages are only informational, so can be safely removed. Bootchart already encodes build-specific information from the system properties. Bug: 24204119 Change-Id: I7ebd65a20a3e031e7528c9f741616e20b3cd7446
* | am 2fb90dc8: Merge changes from topic \'userspace-audit\'Nick Kralevich2015-10-101-8/+23
|\| | | | | | | | | | | * commit '2fb90dc8b2b590e674c5e433e8bf3d3f08a887c8': debuggerd: audit pid, uid and gid on SE Linux denial property_service: log pid,uid and gid of setprop client
| * debuggerd: audit pid, uid and gid on SE Linux denialWilliam Roberts2015-10-061-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging SE Linux audit messages from debuggerd, its unclear what process is triggering the access violation. To assist in debugging, we also log pid, uid and gid. Before: avc: denied { dump_backtrace } for scontext=u:r:dumpstate:s0 ... After: avc: denied { dump_backtrace } for pid=198 uid=1019 gid=1019 .. Change-Id: I8263e6f5e77917139b73c3e84b76f7f97fd98003 Signed-off-by: William Roberts <william.c.roberts@intel.com>
* | am cabf610d: am d29f10cd: Merge "Fix build break due to unknown pragma (on ↵Stephen Hines2015-10-011-0/+4
|\| | | | | | | | | | | | | gcc)." * commit 'cabf610da0799abc302233acf4b3c420543a9c04': Fix build break due to unknown pragma (on gcc).
| * Fix build break due to unknown pragma (on gcc).Stephen Hines2015-09-301-0/+4
| | | | | | | | Change-Id: I36bf855769b243139fd45186ac53578448b87a2b
* | am f141312c: am dc91dafa: Merge "Ignore explicit infinite recursion."Stephen Hines2015-10-011-0/+5
|\| | | | | | | | | * commit 'f141312c826a1c03b10d1e8acd033f39063f7599': Ignore explicit infinite recursion.
| * Ignore explicit infinite recursion.Stephen Hines2015-09-291-0/+5
| | | | | | | | | | | | | | | | Clang 3.8 warns against this now, and it is tripping up part of a test. We suppress the warning, since we are trying to actually test that this behavior is properly handled. Change-Id: I8705900572e1a6704bbdc001fece3e2d16c7077c
* | am 33f02724: am 65744003: Merge "Revert "Revert "Revert "Revert "Add ↵Yabin Cui2015-09-221-0/+1
|\| | | | | | | | | | | | | BacktraceOffline for offline backtracing.""""" * commit '33f027247da687a535ba2264fe98926a38742f68': Revert "Revert "Revert "Revert "Add BacktraceOffline for offline backtracing.""""
| * Revert "Revert "Revert "Revert "Add BacktraceOffline for offline ↵Yabin Cui2015-09-221-0/+1
| | | | | | | | | | | | | | | | backtracing."""" This reverts commit 94ece83270deca76c69f5755f8c0ff5c859341fd. Change-Id: Ie06465c89a5fc115517130f9f2904cc855973155
* | am 27b455bb: am 00ea49fc: Merge "Revert "Revert "Revert "Add ↵Yabin Cui2015-09-221-1/+0
|\| | | | | | | | | | | | | BacktraceOffline for offline backtracing."""" * commit '27b455bb0c2dbab7af14c3434438310a38cb64fa': Revert "Revert "Revert "Add BacktraceOffline for offline backtracing."""
| * Revert "Revert "Revert "Add BacktraceOffline for offline backtracing."""Yabin Cui2015-09-221-1/+0
| | | | | | | | | | | | This reverts commit 0a411c934a81e5c77a27ef5b69d391038f36e969. Change-Id: Ic1824afac6c32f1087b66de9d6368a561f235d13
* | am 92db97de: am ebc49654: Merge "Revert "Revert "Add BacktraceOffline for ↵Yabin Cui2015-09-211-0/+1
|\| | | | | | | | | | | | | offline backtracing.""" * commit '92db97dea06895b0e22e4ad5fd1152dc24c94efa': Revert "Revert "Add BacktraceOffline for offline backtracing.""
| * Revert "Revert "Add BacktraceOffline for offline backtracing.""Yabin Cui2015-09-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit ab5e583327e4dfd9f7c38ab6ed4c4714508ce544. And statically link llvm libraries on host to remove dependency on 32-bit llvm shared library which is not included in the prebuilt. Bug: 22229391 Change-Id: I8210687655ee1809fd820ab2a6ca5dfaf3f9096d
* | resolved conflicts for 5caca3dd to mnc-dr-dev-plus-aospTom Cherry2015-09-212-0/+2
|\ \ | |/ |/| | | Change-Id: I773e514a8232b77cdd566dc36c9efc4e15f206f0
| * Change the 64 bit map address format.Christopher Ferris2015-06-0313-38/+974
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the map printing in tombstones for 64 bit devices uses a variable length value. This means that the maps are not lined up. The new format is to print the map as 00000000'00000000 in all ways. Also fix a bug where the backtrace_map_t did not initialize all parameters. Add unit tests for all of the dump_all_maps function. Bug: 20950813 (cherry picked from commit 862fe029190b6d8344889988fb85526e64b2f4b7) Change-Id: Ife5c48bddeb19006a98f9e87520474e97b97f6d9
| * Refactor dump_memory function.Christopher Ferris2015-05-2815-248/+1000
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add dumping memory around registers for x86/x86_64. - Add unit tests for new dump_memory function. - Cleanup all of the machine.cpp files. - Increase the high address check for 32 bit, and decrease the high address allowed for 64 bit slightly to match mips64. Bug: 21206576 (cherry picked from commit e8bc77eb845ab5557a4c98fe0da604d4a3740bef) Change-Id: I49ec237e30076a232f084da1072bf9aba15dc0cd
| * Don't use TEMP_FAILURE_RETRY on close in system/core.Elliott Hughes2015-05-271-5/+5
| | | | | | | | | | | | Bug: http://b/20501816 Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50 (cherry picked from commit 47b0134ec2b5e8c8b5b5671cd4a3e41261275532)
| * Switch UniquePtr to std::unique_ptr.Christopher Ferris2015-05-152-9/+9
| | | | | | | | | | | | Bug: 21209050 Change-Id: I91d4c44de479b37f2729382fcdf103b8c69aa668 (cherry picked from commit 6e96403b8fd25a98f2cfc9680de45f39ff4ec491)
| * Prevent crashes if a map cannot be created.Christopher Ferris2015-05-152-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under some conditions, /proc/<pid>/maps might return nothing. If we try and unwind in this case, we'll crash. Check this case and fail the unwind. Add checks that no other functions try and use map_ without checking for nullptr. Add logging when an unwind fails so it's clear what happened. Bug: 21162746 Change-Id: I56ce51dda0cfc9db20475a441f118108196aa07c (cherry picked from commit 30c942cf1024bf791c28ab9b67a1f752de72248c)
| * Add offset to map data.Christopher Ferris2015-05-061-1/+2
| | | | | | | | | | | | | | | | Also, print the offset in the maps section. Bug: 20864928 Change-Id: I71f005726e5ef73cf75bbcb8f829fd5127cb9d61 (cherry picked from commit 5c8856854de4ae7836fc1073d534f4b7b7a03eb9)
| * All debuggerd log output marked fatal.Christopher Ferris2015-05-052-2/+2
| | | | | | | | | | | | | | | | | | This avoids the log daemon skipping some of the log output from debuggerd. Bug: 20846525 (cherry picked from commit b0412a5c2b446edb137980333aa0a0bbfda2e955) Change-Id: Ifed48814d76c7e855645b6d5487d5e6e1fcafd9e
| * Add load base to map for relocation packing.Christopher Ferris2015-05-011-0/+3
| | | | | | | | | | | | | | | | | | | | The new linker relocation packing support uses non-zero load bases, so we better handle them properly. Also print out the load base for a map if it's non-zero. Bug: 20687795 Change-Id: Iec2d1db2051e7b4a278c1dfa57d745128a7f2974
| * Use WriteFully in debuggerd to talk to ActivityManager.Elliott Hughes2015-04-271-16/+3
| | | | | | | | | | | | (cherry picked from commit b7cd09b93eaa8efa42db880a419d8d845dd4b4b3) Change-Id: Ic81b4134fe563d8ebb15ba4ff3e9b2e8893c97a5
* | bundle init.rc contents with its serviceTom Cherry2015-08-213-0/+7
| | | | | | | | | | Bug: 23186545 Change-Id: I52616b8ab1165fdef716f9b8f958665f2308c12e
* | bionic no longer sends SIGPIPE to debuggerd.Elliott Hughes2015-07-304-10/+1
| | | | | | | | | | | | | | | | | | Static binaries don't get the signal handler installed (that's done by the dynamic linker) so we don't need to worry about seeing SIGPIPE crashes from old binaries. Bug: http://b/20659371 Change-Id: I3b5566634fadd3e822262561188d29814bccd1fd
* | Merge "Dump memory going from unreadable to readable."Christopher Ferris2015-07-093-11/+270
|\ \
| * | Dump memory going from unreadable to readable.Christopher Ferris2015-07-093-11/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the first read when dumping memory returns no data, skip ahead to the next page boundary and try and read from there. This fixes a case where the address at which to start dumping memory is unreadable, but crosses back into readable memory. Bug: 22234753 Change-Id: Ie28d5c027013577ca06f5396aba498366a3b6749
* | | New property that determines when to wait for gdb.Christopher Ferris2015-07-081-4/+1
|/ / | | | | | | | | | | | | | | | | Use debug.debuggerd.wait_for_gdb being set to non-zero to determine if debuggerd should stop and wait for someone to attach gdb to the crashing process. Bug: 22233908 Change-Id: Id55a1572b479a70d395b7270392ce6fb70dbfdca
* | Merge "Replace all _LOG error calls with ALOGE."Christopher Ferris2015-07-0814-55/+100
|\ \
| * | Replace all _LOG error calls with ALOGE.Christopher Ferris2015-07-0114-55/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The debuggerd code sometimes calls _LOG(..., logtype::ERROR, ...) and sometimes ALOGE(). Standardize on ALOGE since the _LOG message will wind up in the tombstone in weird places, but using ALOGE will wind up in the logcat portion of the tombstone. Bug: 21467089 Change-Id: Ie893f5e91d45b48ef3f5864c3a714e60ac848fb3
* | | Fix debuggerd's gdbclient instructions.Elliott Hughes2015-07-071-20/+6
|/ / | | | | | | | | | | | | | | We improved gdbclient to make the process simpler, but didn't update debuggerd to match. Bug: http://b/22233857 Change-Id: If4137943f567a9e566a3ac7f485c9b1eab2c68e9
* | Remove calls to is_selinux_enabled()Nick Kralevich2015-06-121-6/+0
| | | | | | | | | | | | | | | | | | | | | | d34e407aeb5898f19d4f042b7558420bbb3a1817 removed support for running with SELinux completely disabled. SELinux must either be in permissive or enforcing mode now. Remove unnecessary calls to is_selinux_enabled(). It always returns true now. Change-Id: Ife3156b74b13b2e590afe4accf716fc7776567e5
* | Change the 64 bit map address format.Christopher Ferris2015-06-0313-38/+974
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the map printing in tombstones for 64 bit devices uses a variable length value. This means that the maps are not lined up. The new format is to print the map as 00000000'00000000 in all ways. Also fix a bug where the backtrace_map_t did not initialize all parameters. Add unit tests for all of the dump_all_maps function. Bug: 20950813 Change-Id: I30901c8a0251b00d85c4c01476b033ef8db84e32
* | Merge "Refactor dump_memory function."Christopher Ferris2015-05-2815-248/+1000
|\ \
| * | Refactor dump_memory function.Christopher Ferris2015-05-2715-248/+1000
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add dumping memory around registers for x86/x86_64. - Add unit tests for new dump_memory function. - Cleanup all of the machine.cpp files. - Increase the high address check for 32 bit, and decrease the high address allowed for 64 bit slightly to match mips64. Bug: 21206576 Change-Id: I6f75141f3282db48b10f7c695a1cf2eb75a08351
* | | Don't use TEMP_FAILURE_RETRY on close in system/core.Elliott Hughes2015-05-151-5/+5
|/ / | | | | | | | | Bug: http://b/20501816 Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
* | Switch UniquePtr to std::unique_ptr.Christopher Ferris2015-05-152-9/+9
| | | | | | | | | | Bug: 21209050 Change-Id: I91d4c44de479b37f2729382fcdf103b8c69aa668
* | Prevent crashes if a map cannot be created.Christopher Ferris2015-05-142-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Under some conditions, /proc/<pid>/maps might return nothing. If we try and unwind in this case, we'll crash. Check this case and fail the unwind. Add checks that no other functions try and use map_ without checking for nullptr. Add logging when an unwind fails so it's clear what happened. Bug: 21162746 Change-Id: I56ce51dda0cfc9db20475a441f118108196aa07c