summaryrefslogtreecommitdiffstats
path: root/debuggerd/tombstone.cpp
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-071-1/+1
|\ | | | | | | | | | | 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
| * Don't create tombstone directory.Josh Gao2016-02-261-14/+1
| | | | | | | | | | | | | | Partial backport of cf79748. Bug: http://b/26403620 Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee
* | debuggerd: add CM version to tombstonesScott Mertz2016-05-251-0/+3
| | | | | | | | Change-Id: I7822a2e133a2f326ad2d8da8f79b0064344d59bf
* | Don't create tombstone directory.Josh Gao2016-03-011-14/+1
|/ | | | | | | Partial backport of cf79748. Bug: http://b/26403620 Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee
* Change the 64 bit map address format.Christopher Ferris2015-06-031-10/+27
| | | | | | | | | | | | | | | | 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-281-1/+1
| | | | | | | | | | | | | - 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
* Switch UniquePtr to std::unique_ptr.Christopher Ferris2015-05-151-7/+6
| | | | | | Bug: 21209050 Change-Id: I91d4c44de479b37f2729382fcdf103b8c69aa668 (cherry picked from commit 6e96403b8fd25a98f2cfc9680de45f39ff4ec491)
* Prevent crashes if a map cannot be created.Christopher Ferris2015-05-151-1/+7
| | | | | | | | | | | | | | | 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-051-1/+1
| | | | | | | | | 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
* Print the build id of shared libraries if present.Christopher Ferris2015-03-171-60/+81
| | | | | | | | | | | | 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
* 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
* #include <arpa/inet.h> for htonl.Elliott Hughes2014-12-181-0/+1
| | | | | Not sure why this only shows up with clang. Change-Id: Id5603483e32f8a8d4b091dbb31b3142e3f77deac
* am a11ac455: Merge "Fix debuggerd issues."Christopher Ferris2014-11-031-7/+7
|\ | | | | | | | | * commit 'a11ac45536f0722becefccdb6b58378c5d9d0d4b': Fix debuggerd issues.
| * Fix debuggerd issues.Christopher Ferris2014-11-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 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-291-0/+10
|\ \ | |/ | | | | | | | | | | request for logd process" * commit '1d497f8a92994abeb5baeaacdec037268838af20': debuggerd: tombstone: suppress logger request for logd process
| * debuggerd: tombstone: suppress logger request for logd processMark Salyzyn2014-07-281-0/+10
| | | | | | | | Change-Id: I619880342ee6febd1a6cc98d2a4f536120efc1c8
* | debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstonesNick Kralevich2014-07-161-2/+2
|/ | | | Change-Id: I71bdfba30346a9fad3129b404f39eda8190698e3
* Fix LP64 tombstone.cpp build failure.Elliott Hughes2014-07-081-1/+1
| | | | Change-Id: Id071417f56dd883e9d2e38a6f3296cb23a0352fb
* Improving maps output.Brigid Smith2014-07-081-15/+19
| | | | | | | | | | | | | | | Maps output now displays fault address location more intelligently. If the fault is not in a mapped region, it now shows where that address is with respect to the other maps. In addition, the size of the map is now printed as part of the output. Also, crasher now supports an "mmap" option which mmaps/munmaps a region of memory and then attempts to access it, causing a fault address in between mapped regions that can be used to test that new part of the maps output. Change-Id: Ia5e1926802bdfcbbdb7857e3631ddf395ae0c5b8
* debuggerd: synchronize cosmetics to internalMark Salyzyn2014-06-271-13/+9
| | | | Change-Id: I66bc2b181cd75da188c046571492224d5ac3fc98
* tombstone: log output header suppressed in crashMark Salyzyn2014-06-271-1/+1
| | | | | Bug: 15520846 Change-Id: I18934cc60af3dda98ab729fbabc4c7a66834512e
* Print ABI in backtraces.Michael Wright2014-06-241-15/+0
| | | | | | | This lets the stack tool figure out which toolchain to use automatically. Change-Id: Ia235d6904622423fe6fbc7b0315a1861e52a41ad
* Fixing debuggerd header output.Brigid Smith2014-06-231-3/+2
| | | | | | PID and TID output line was missing. Change-Id: I609af5727bc22ea0b97f3975ddb3cf0102910bc2
* Maps output now marks the fault address location.Brigid Smith2014-06-201-4/+13
| | | | | | | | If the fault address is not within a mapped region, it logs an error message after the output. Otherwise, it prefixes the location of the fault address with "--->" to make it easier to locate. Change-Id: I330adaade4402ffeb09f1a6d34a944c2f054d06d
* Removed log.quiet and log = NULL cases from debuggerd.Brigid Smith2014-06-191-16/+15
| | | | | | | | | Now the functionality implemented by these semi-confusing cases has been replaced with the same logtype enum behavior that is easier to understand, and cases that used log-looking behavior to print to logcat (when log = NULL) now use the more transparent ALOGE/ALOGD functions. Change-Id: I7e38f2d4ca74a828df4d2266b3ea34edd3c6f5bb
* Changed maps output in debuggerd.Brigid Smith2014-06-171-28/+4
| | | | | | | | | | | Now the map output is only sent to the tombstone, and the entire contents of /prod/$PID/maps is logged, not just 3 lines. Additionally, crasher now supports "crasher SIGSEGV-non-null", which attempts to write to a dereferenced function address, causing a SIGSEGV at a non-zero address. This new crasher mode can be used to test the new maps output. Bug: 15343662 Change-Id: I796d92e8352a6b9714bbbfe96f3143c56565ef2f
* Changing how debuggerd filters log messages to different locations.Brigid Smith2014-06-161-79/+84
| | | | | | | | | | | | | The system by which debuggerd filters its output to different locations is now based on an enum called logtype with easy to understand categories for log messages (like THREAD, MEMORY, etc.) instead of the old, fairly esoteric scope_flags variable. Now much of the output that previously went to logcat does not show up on the screen, but all output can be found in the tombstone file. In addition, the tombstone's location is now printed so it can be located easily. Bug: 15341747 Change-Id: Ia2f2051d1dfdea934d0e6ed220f24345e35ba6a2
* Adding ABI output to debuggerd tombstones.Brigid Smith2014-06-041-11/+21
| | | | | Bug: 15084471 Change-Id: If9fb260a3403e86f80928f2f5f79331fc0936030
* logd: logcat: debuggerd: audit logs to events and mainMark Salyzyn2014-05-271-1/+0
| | | | | | | | | | | - auditd spawn log copy to events and main - logcat delete events as one of the default logs - debuggerd do not collect events. - squish multiple spaces - switch from strcpy to memmove for overlapping buffers BUG: 14626551 Change-Id: I89b30273ce931ed2b25a53ea9be48e77f4c1bbf4
* Teach debuggerd the name of SIGTRAP.Elliott Hughes2014-05-161-4/+5
| | | | | | | Also add SIGTRAP to the list of signals we don't want to double fault on. Bug: 15024256 Change-Id: I23ab80800563c007fcd3e42527329fedf762f0c8
* logd: logcat: debuggerd: auditd logs to eventsMark Salyzyn2014-05-151-9/+27
| | | | | | | | | | | - auditd switch to recording logs to events log id - logcat add events as one of the default logs - debuggerd collect events log as well. ToDo: debuggerd & bugreport collect intermixed logs. BUG: 14626551 Change-Id: I958f0e729b7596748be57488a38824db5645be7b
* Log stack even if tombstone cannot be created.Christopher Ferris2014-05-051-10/+17
| | | | | Bug: 14498701 Change-Id: I62c271bef2f73166eeb91d3fa3ce1e1b724a081f
* Use the si_code value bionic passes us.Elliott Hughes2014-04-251-20/+27
| | | | | | | | | Bionic needs to re-raise various signals, which means the si_code debuggerd sees has been clobbered. If bionic sends us the original si_code value, we can use that instead of the one we see when the ptrace the crashed process' siginfo. Change-Id: If116a6bc667d55a6fb39b74f96673292af4e4c8c
* Add missing si_code values to debuggerd.Elliott Hughes2014-04-241-6/+10
| | | | | | Also add static_asserts so we'll be notified if any more new ones show up. Change-Id: I3a502dd4da35354e1ac65865191d31ccdacef298
* Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."Nick Kralevich2014-02-121-1/+1
|\
| * Convert all selinux_android_restorecon and _setfilecon calls to new API.Stephen Smalley2014-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | libselinux selinux_android_restorecon API is changing to the more general interface with flags and dropping the older variants. Also get rid of the old, no longer used selinux_android_setfilecon API and rename selinux_android_setfilecon2 to it as it is the only API in use. Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | Use stat structure to keep oldest mtime.Christopher Ferris2014-02-071-20/+11
|/ | | | Change-Id: If9496127db28d2dcd09bc5b3144632a43afb8d55
* Fix debuggerd's symbol offset output.Elliott Hughes2014-01-311-2/+2
| | | | | | | | | | Before: 00007fff33e489d8 00007ff286e4ad94 /system/lib64/libc.so (__libc_init+54u) After: 00007fff45c6c158 00007f61bc36fd94 /system/lib64/libc.so (__libc_init+84) Change-Id: I36796c99843a41583824a96793a5a4c81ddb666e
* AArch64: Port debuggerdKévin PETIT2014-01-301-1/+5
| | | | | Change-Id: Ib18f76f375a1d70c84e0a09d221e17ac43144b96 Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
* LP64: Enable debuggerd/libbacktrace/libunwind.Pavel Chupin2014-01-301-27/+18
| | | | | Change-Id: I2e432839f86c33c2adbaac8cc12ca8961956044b Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* debuggerd: a few generic improvementsKévin PETIT2014-01-301-14/+18
| | | | | | | | | | This one makes dump_memory reasonably architecture-agnostic so it is possible to share the code between architectures. It also includes a few small improvements in tombstone.cpp. Change-Id: Ib8a9599bfa420b41e80207988e87aee1b9d79541 Signed-off-by: Kévin PETIT <kevin.petit@arm.com>