summaryrefslogtreecommitdiffstats
path: root/debuggerd
Commit message (Collapse)AuthorAgeFilesLines
* debuggerd: Rebrand tombstone header to ReplicantHEADreplicant-6.0-0001replicant-6.0Wolfgang Wiedmeyer2017-05-021-1/+1
| | | | Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* debuggerd: Rebrand tombstone header to LineageOSHarry Youd2017-02-111-1/+1
| | | | | Change-Id: Idd08c2eb7e395b464b1510742bf52833f465db08 (cherry picked from commit 4a427dfce617e1c3cc8b85b7196be24b495d9f4e)
* Merge tag 'android-6.0.1_r66' into HEADJessica Wagantall2016-09-075-13/+68
|\ | | | | | | | | | | Android 6.0.1 release 66 Change-Id: I5ccc6e68283e30b8d0419eb7512c7183e58ec5ed
| * debuggerd: fix missed use of ptrace(PTRACE_ATTACH).Josh Gao2016-08-091-1/+1
| | | | | | | | | | Bug: http://b/29555636 Change-Id: Ibd8a2e2b619b74aac667555b7085d6f28e367c07
| * DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.Josh Gao2016-07-214-11/+66
| | | | | | | | | | | | | | | | | | | | | | | | 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. Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591 Bug: http://b/29555636 Change-Id: I6c6efcf82a49bca140d761b2d1de04215ba4d252
| * Don't create tombstone directory.Josh Gao2016-02-261-14/+1
| | | | | | | | | | | | | | Partial backport of cf79748. Bug: http://b/26403620 Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee
* | Copy the ETB dumps and maps file to /data/coreMaunik Shah2016-06-301-0/+80
| | | | | | | | | | | | | | On enabling the persist.debug.trace, ETB maps and dumps will be copied to /data/core only for the first crash. Change-Id: I521ee02e30ce1b4ebaca2c6b398c828286a5115d
* | debuggerd: add CM version to tombstonesScott Mertz2016-05-251-0/+3
| | | | | | | | Change-Id: I7822a2e133a2f326ad2d8da8f79b0064344d59bf
* | Merge tag 'android-6.0.1_r24' into HEADJessica Wagantall2016-04-051-14/+1
|\ \ | | | | | | | | | | | | Ticket: CYNGNOS-2213 Android 6.0.1 release 24
| * | Don't create tombstone directory.Josh Gao2016-03-011-14/+1
| | | | | | | | | | | | | | | | | | | | | Partial backport of cf79748. Bug: http://b/26403620 Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee
| * | Remove __DATE__/__TIME__ from init and debuggerdDan Willemsen2015-10-301-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 (cherry picked from commit 30622bbb209db187f6851e4cf0cdaa147c2fca9f)
| * | Fix incorrect check of descsz value.Christopher Ferris2015-10-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 25187394 (cherry picked from commit 1fa55234d6773e09e3bb934419b5b6cc0df981c9) Change-Id: Idbc9071e8b2b25a062c4e94118808d6e19d443d9
* | | Merge tag 'android-6.0.1_r13' into 13.0Jessica Wagantall2016-02-011-4/+4
|\ \ \ | | |/ | |/| | | | | | | | | | | | | Android 6.0.1 release 13 Ticket: CYNGNOS-1522 Change-Id: I545ab024197c1a9f29111a120dd6281a74036c8c
| * | Fix incorrect check of descsz value.Christopher Ferris2015-12-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 25187394 (cherry picked from commit 1fa55234d6773e09e3bb934419b5b6cc0df981c9) Change-Id: Idbc9071e8b2b25a062c4e94118808d6e19d443d9
* | | Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-071-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | https://android.googlesource.com/platform/system/core into HEAD Android 6.0.1 release 3 Change-Id: I8b65c0223e3444360432abd871a9d8f007831ba0
| * | Remove __DATE__/__TIME__ from init and debuggerdDan Willemsen2015-11-031-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 (cherry picked from commit 30622bbb209db187f6851e4cf0cdaa147c2fca9f)
* | Provide better advice on using gdb with debuggerd on crashed applications.Pete Delaney2015-10-291-2/+18
|/ | | | | | | | | | | | | | | | | Let CyanogenMod developers know of a Cyanogen enhancement made by Clark Scheff and Steve Kondik where the graphical debugger interface ddd can be used with crashed applications. The new in-line function, dddclient, is now available in addition to the std Google gdbclient interface. Also, let users know that they have set their property debug.db.uid too low to enable debuggerd to wait for gdb to attach. If they haven't set debug.db.uid; let them know; and offer a hint on how to do it, without their having to Google for the web page. Change-Id: I467d861c0fffe34e8532a8bc7cf7bfdab9f56447 Signed-off-by: Pete Delaney <piet@cyngn.com>
* 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
* Fix alignment when reading note segment.Yabin Cui2015-04-141-2/+4
| | | | | | | | ELF said that padding is present, if necessary, to ensure 4-byte alignment for the descriptor and next note entry, but such padding is not included in namesz and descsz. Change-Id: I7896783f3d9a787772d56c49905f52a493c9fba1
* Print the build id of shared libraries if present.Christopher Ferris2015-03-174-61/+229
| | | | | | | | | | | | For every map that has a name, and if it's a mapped in shared library, print the build id. Refactor the way dump_all_maps logs data. Refactor the way stack segments are dumped. Bug: 19371018 Change-Id: Ic08d05a4b13f128925743936fb84d8059f7cb56f
* Add backtrace support for mips64.Douglas Leung2015-03-094-3/+153
| | | | Change-Id: I12ea2fcbe6780bb596f51988eae1ceafcec858df
* liblog: introduce ANDROID_LOG_* flagsMark Salyzyn2015-02-251-1/+1
| | | | | | | | Move away from using POSIX open(2) flags and introduce ANDROID_LOG_* flags to replace them. Add security by preventing random mode flags from getting into underlying POSIX calls. ANDROID_LOG_* flags overlap POSIX O_* flag definitions. Change-Id: Ib32bb64c287e8bf150be62242e1ba46bb37839fc
* Do not dump maps/memory/code of sibling threads.Christopher Ferris2015-02-091-43/+39
| | | | | | | | | | | | | | | Modifies the code so that if the unwind fails, the code still prints as much data as possible. Also, for sibling threads, skip printing the maps and memory/code since it's not likely to be very relevant. Fix a few cases where extra space is at the end of lines. Fix an inverted if statement that was checking the wrong condition. Bug: 18816322 Change-Id: Ic659e0c34489bf2c65c5a23e2b83e31653b927e4
* Move map data into backtrace data proper.Christopher Ferris2015-02-061-3/+4
| | | | | | | | | | | The backtrace structure used to include a pointer to a backtrace_map_t that represented the map data for a particular pc. This introduced a race condition where the pointer could be discarded, but the backtrace structure still contained a pointer to garbage memory. Now all of the map information is right in the structure. Bug: 19028453 Change-Id: If7088a73f3c6bf1f3bc8cdd2bb4b62e7cab831c0
* Remove the pt_regs_mips_t structure.Christopher Ferris2015-01-261-14/+2
| | | | | | | The kernel finally has the pt_regs structure properly defined for mips, so we don't need to define it ourselves. Change-Id: Ifdf75ed827cd2390962e9b3a182bdbbf02fe0732
* Move 32 bit/64 bit check into debuggerd.Christopher Ferris2015-01-202-2/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | On 64 bit systems, calls to dump_backtrace_to_file or dump_tombstone try and directly contact the correct debuggerd (32 bit vs 64 bit) by reading the elf information for the executable. Unfortunately, system_server makes a call to dump_backtrace_to_file and it doesn't have permissions to read the executable data, so it defaults to always contacting the 64 bit debuggerd. This CL changes the code so that all dump requests go to the 64 bit debuggerd, which reads the elf information and redirects requests for 32 bit processes to the 32 bit debuggerd. Testing: - Forced the watchdog code in system_server to dump stacks and verified that all native stacks are dumped correctly. - Verified that dumpstate and bugreport still properly dump the native processes on a 64 bit and 32 bit system. - Intentionally forced the 64 bit to 32 bit redirect to write only a byte at a time and verified there are no errors, and no dropped data. - Used debuggerd and debuggerd64 to dump 32 bit and 64 bit processes seemlessly. - Used debuggerd on a 32 bit system to dump native stacks. Bug: https://code.google.com/p/android/issues/detail?id=97024 Change-Id: Ie01945153bdc1c4ded696c7334b61d58575314d1
* #include <arpa/inet.h> for htonl.Elliott Hughes2014-12-182-0/+3
| | | | | Not sure why this only shows up with clang. Change-Id: Id5603483e32f8a8d4b091dbb31b3142e3f77deac
* Make crasher smash-stack work.Yabin Cui2014-12-111-10/+18
| | | | | Bug: 18721888 Change-Id: Id0280df7cb2c29832256d3d395e6399fcef9aa2b
* Print ASCII near register for all archsDmitriy Ivanov2014-12-101-8/+0
| | | | | Bug: 17880617 Change-Id: I6870e8ac670c08e45d8efb64479976a38edfdc93
* Move debuggerd to libc++.Dan Albert2014-11-151-2/+0
| | | | | Bug: 15193147 Change-Id: I935a08e98077b688d1735fb5b84a615cb7df8810
* am a11ac455: Merge "Fix debuggerd issues."Christopher Ferris2014-11-035-63/+56
|\ | | | | | | | | * commit 'a11ac45536f0722becefccdb6b58378c5d9d0d4b': Fix debuggerd issues.
| * Fix debuggerd issues.Christopher Ferris2014-11-035-63/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix a problem where a tid exits before the attach completes, and it causes debuggerd to self terminate. - Fix a problem where sibling tid dumps do not properly wait for the tid to get signalled. Bug: 17800180 Bug: 12567315 (cherry picked from commit 84ddb34a3af77dbe490aaa07b738bbfd7109d5ba) Change-Id: I45e33865614d4c96f4a89cf117398666b556d500
* | am d88323b2: Merge "Add volatile to avoid clang optimization."Chih-Hung Hsieh2014-10-281-1/+1
|\ \ | |/ | | | | | | * commit 'd88323b2667c443c2738eb601eb0b9eaad1c3049': Add volatile to avoid clang optimization.
| * Add volatile to avoid clang optimization.Chih-Hung Hsieh2014-10-231-1/+1
| | | | | | | | | | BUG: 18108178 Change-Id: Ie5b8b1808fcf6d1eacc14a7c6ac0c8d49641fec2
* | am c3e6eb21: Merge "Move ABI: line below header when dumping stacks." into ↵Jeff Brown2014-09-121-2/+2
|\ \ | | | | | | | | | | | | | | | | | | lmp-dev * commit 'c3e6eb21b58ae3067ed03358687d1edb851f2abf': Move ABI: line below header when dumping stacks.
| * | Move ABI: line below header when dumping stacks.Jeff Brown2014-09-111-2/+2
| | | | | | | | | | | | | | | Bug: 17474152 Change-Id: I66b6e7e1cbb004f7a1915a2c1515df6555fe176f
| * | Do not suppress maps dump when si_addr<PAGE_SIZEDmitriy Ivanov2014-08-111-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove alignment of si_addr. (cherry picked from commit f10aa3ae9d58269465c579e4c286ccef6be4c2d0) Bug: 16950250 Change-Id: I60170b9eb7dd8fe99c0eeeaec74d13cfbaa920d9
| * | debuggerd: tombstone: suppress logger request for logd processMark Salyzyn2014-07-292-1/+13
| | | | | | | | | | | | | | | | | | (cherry pick from 45ae446cab9cfc9b6100d91b1a37c6ad82e0cb99) Change-Id: I619880342ee6febd1a6cc98d2a4f536120efc1c8
| * | Added default constructor for log_t.Brigid Smith2014-07-292-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 16357258 (cherry picked from commit c75a02fe3f9abec006a1e88794f2fa12fbeafd8f) Change-Id: I96be34ee1664af54b0dcbc928ea542cd749852fd
* | | am 75ef453e: am 2f40ddf3: Merge "Do not suppress maps dump when ↵Dmitriy Ivanov2014-08-101-9/+6
|\ \ \ | | |/ | |/| | | | | | | | | | | | | si_addr<PAGE_SIZE" * commit '75ef453e5d3352aad8c55cd8fa572945c6f4bbfa': Do not suppress maps dump when si_addr<PAGE_SIZE
| * | Do not suppress maps dump when si_addr<PAGE_SIZEDmitriy Ivanov2014-08-091-9/+6
| | | | | | | | | | | | | | | | | | Also remove alignment of si_addr. Change-Id: Ie5445bf8a5baa49e04e37c643c25ebd0f1dc9d22
* | | am 1d497f8a: am cddc97cb: Merge "debuggerd: tombstone: suppress logger ↵Mark Salyzyn2014-07-292-1/+13
|\ \ \ | |/ / | | | | | | | | | | | | | | | request for logd process" * commit '1d497f8a92994abeb5baeaacdec037268838af20': debuggerd: tombstone: suppress logger request for logd process