summaryrefslogtreecommitdiff
path: root/debuggerd/libdebuggerd
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-13.0.0_r52' of ↵George Zacharia2023-07-021-2/+8
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/system/core into xb Android 13.0.0 Release 52 (TQ3A.230605.012) Change-Id: Idd86c936487bfbc0181743dccce9d1f9f08bbe5c
| * Display offset in backtraces if necessary.Christopher Ferris2023-02-011-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When moving to a proto tombstone, backtraces no longer contain an offset when a frame is in a shared library from an apk. Add the offset display again if needed, and add a test to verify this behavior. Bug: 267341682 Test: All unit tests pass. Test: Dumped a process running through an apk to verify the offset Test: is present. Change-Id: Ib720ccb5bfcc8531d1e407f3d01817e8a0b9128c (cherry picked from commit 22035ccb01693da3e0ec94776c86988c7d5c617e)
| * Fix check for thread unwind.Christopher Ferris2022-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If a process requires executing fallback unwinder and the thread crashing is not the main thread, the wrong unwinder is used. Fix this case, and add a new unit test that causes an abort in the non main thread. Bug: 233721755 Test: New unit test passes with fix and fails without. Test: Ran debuggerd on swcodec process and it still dumps all threads. Change-Id: I70fffc5d680256ce867e7a1d427593b584259160
| * Merge "[GWP-ASan] Enable debuggerd to pull more allocation metadata."Mitch Phillips2022-04-211-2/+5
| |\
| | * [GWP-ASan] Enable debuggerd to pull more allocation metadata.Mitch Phillips2022-04-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the addition of runtime-configurable GWP-ASan, there might be many, many more than 1,000 allocations. Have support for them, but keep a hopefully-won't-crash-the-device limit. Bug: 219651032 Test: atest bionic-unit-tests Change-Id: I7b8e2bf5ab7c723ab6c61365f0dc610e400dbbce
| * | Update for SetProcessMemory removal.Christopher Ferris2022-04-191-2/+2
| |/ | | | | | | | | | | | | Bug: 120606663 Test: All unit tests pass. Change-Id: Icf8a3ceb75b8962f8f215501c2bac631b40a1527
| * Update for accurate unreadable elf files.Christopher Ferris2022-03-152-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | The functionality moved from the Unwinder object to the MapInfo object and means that the individual unreadable files can be displayed now. Included adding the unreadable elfs per thread in the protobuf. Updated the unwinder test. Test: All unit tests pass. Change-Id: I7140bde16938736da005f926e10bbdb3dbc0f6f5
| * Remove dead non-proto tombstone reporting code.Peter Collingbourne2022-03-075-422/+0
| | | | | | | | | | Bug: 197981919 Change-Id: I58a98070198ef0b686229bd54f87b9073df12d66
| * Dump threads in tombstone fallback path.Christopher Ferris2022-02-162-91/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dumping a tombstone using the fallback path, only the main thread was showing up. Modify the code to dump the threads using a slightly different path for the tombstone generation code. In addition, while looking at this code, two MTE variables were not set in the tombstone fallback code. Added those variables so MTE devices will work properly in this fallback path. Modified the tombstone unit tests for seccomp to have multiple threads and verify those threads show up in the tombstone. Bug: 208933016 Test: Ran unit tests. Test: Ran debuggerd <PID> on a privileged process and verified Test: all threads dumped. Also verified that the tagged_addr_ctrl Test: variable is present on the raven device. Change-Id: I16eadb0cc2c37a7dbc5cac16af9b5051008b5127
| * Merge "debuggerd: add the PAC keys to the tombstones."Elliott Hughes2022-01-146-43/+64
| |\
| | * debuggerd: add the PAC keys to the tombstones.Elliott Hughes2022-01-136-43/+64
| | | | | | | | | | | | | | | | | | | | | | | | Hard to get otherwise if you're trying to debug PAC issues. Bug: http://b/214314197 Test: treehugger Change-Id: I2e5502809f84579bf287364e59d6e7ff67770919
| * | Update for MapInfo objects in frame data.Christopher Ferris2022-01-064-20/+16
| |/ | | | | | | | | | | | | | | | | | | | | The frame data no longer contains map_XXX fields which represent the map data. Now there is only a shared pointer to the MapInfo object with which this frame is associated. Bug: 120606663 Test: Unit tests pass. Change-Id: I89282963f742f6fcc07e48533da4108dc16bdce9
| * Remove non-protobuf path.Christopher Ferris2021-11-192-852/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | It is expensive to keep the non-protobuf path around and it hasn't been used for an entire release without anyone noticing, so remove it. Create new end-to-end unit tests that cover tests of the non-proto code paths that are being deleted. Bug: 197981919 Test: Unit tests pass. Change-Id: Ia1c45572300bd63e5f196ad61e5e5386830c8ece
| * Merge "Improvements to tombstone output."Treehugger Robot2021-11-123-5/+6
| |\
| | * Improvements to tombstone output.Peter Collingbourne2021-11-113-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use "likelihood" instead of "probability" since that has connotations of being less precise, and our probability ordering isn't very precise anyway. - Hide the fault address with SEGV_MTEAERR because it is not available. - Pad the fault address with leading zeroes to make it clearer which bits of the top byte (and any following bytes such as PAC signature bits) are set. Bug: 206015287 Change-Id: I5e1e99b7f3e967c44781d8550bbd7158eb421b64
| * | Merge "Add a human readable description of the tagged_addr_ctrl value to ↵Peter Collingbourne2021-11-105-2/+66
| |\ \ | | |/ | |/| | | | tombstones."
| | * Add a human readable description of the tagged_addr_ctrl value to tombstones.Peter Collingbourne2021-11-055-2/+66
| | | | | | | | | | | | Change-Id: Ib9860b282cf749891e0f6ef7697669b94235c236
| * | Update for libunwindstack shared_ptr MapInfos.Christopher Ferris2021-10-283-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 120606663 Test: Unit tests pass. Change-Id: Ieae157388e8571345ed8968a2b5c2aa34464689f Merged-In: Ieae157388e8571345ed8968a2b5c2aa34464689f (cherry picked from commit 853733b627dc5bbb07b2463a1f10f10ddee06bbc)
| * | Merge "Revert "strerror: incl enum name""Steven Moreland2021-10-071-1/+1
| |\ \
| | * | Revert "strerror: incl enum name"Steven Moreland2021-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "strerror: incl enum name" Revert submission 1833622-usable-strerror Reason for revert: b/202330586 Bug: 202330586 Reverted Changes: I4d8f617a0:Track strerror(3) change. I8ea86220c:strerror: incl enum name I407bd9f4d:strerror: incl enum name Change-Id: I293ac322160c6a82ff7004a3de085cafbd514458
| * | | Merge "strerror: incl enum name"Elliott Hughes2021-10-061-1/+1
| |\| |
| | * | strerror: incl enum nameSteven Moreland2021-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strerror is nice, but usually I don't care about the text, I care about the uppercase enum Bug: N/A Test: N/A Change-Id: I8ea86220cb04cbded701379c47b8aba8ea8864b8
| * | | Add CHECK to verify assumptions in the code.Christopher Ferris2021-09-282-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the main thread, the siginfo pointer will never be nullptr. Add a CHECK to make sure this is true. Test: Unit tests pass both 32 bit and 64 bit. Test: Ran with debug.debuggerd.translate_proto_to_text set to 0 Test: to exercise old path. Change-Id: I9d5ed0de5d652de8a4f9cd85eb57cbb1ec676404
| * | | Merge "Disable scudo when using svelte config."Christopher Ferris2021-09-252-23/+36
| |\ \ \
| | * | | Disable scudo when using svelte config.Christopher Ferris2021-09-242-23/+36
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was added, but a svelte config still tries to use scudo related code that doesn't exist. Bug: 201007100 Test: Ran unit tests on normal config. Test: Ran unit tests on svelte config. Change-Id: Ic84bae37717d213121aef182bac2f82dbee25213
| * / / libdebuggerd: fix process uptime.Elliott Hughes2021-09-211-24/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was here because we have a case where timeout(1) kills logcat, but debuggerd alleges that the process that was killed had started less than a second ago. I'm not sure this is the problem there, but I did notice that far too many tombstones were claiming improbably short process uptimes. It turns out that the code was measuring the *thread* uptime, not the *process* uptime. Also simplify the code a bit by switching to sysinfo(2) rather than reading a file. Test: manual, plus the existing unit test Change-Id: Ie2810b1d5777ad9182be92bfb3f60795dc978b24
| * / Add fault address marker in proto to tombstone.Christopher Ferris2021-08-231-2/+45
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the switch was made to dump the tombstone from the protobuf, the fault address marker in the maps section went missing. Re-add that logic and add new unit tests to verify all of the different behaviors. Bug: 193935960 Test: All unit tests pass. Test: All unit tests pass when setprop debug.debuggerd.translate_proto_to_text 0 Test: The above on cuttlefish, 32 bit and 64 bit. Test: The above on a flame, 32 bit and 64 bit. Change-Id: I098bb6ab4bacacae2ca0fc5ec9a73549ed0b9489
| * Remove trailing newlines from abort message.Christopher Ferris2021-08-182-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | The tombstone will add a newline after the abort message, so remove any trailing newlines before saving/printing. Bug: 196414062 Test: Unit tests pass. Test: Set system property debug.debuggerd.translate_proto_to_text to 0 test: and unit tests still pass. Change-Id: I0d3dc215eb5d8be93d99e5b9d4f0a14b1d61396d
| * Update for new TRAP_PERF value.Christopher Ferris2021-07-011-1/+3
| | | | | | | | | | | | | | | | For the new kernel 5.13 heders, there is a new TRAP_PERF value that needs to be handled. Test: Builds. Change-Id: I2c6658ca94423c210db9ad6692ec69f6be69b3f5
| * Merge "[MTE] Add a HWASan-style tag dump to tombstones."Treehugger Robot2021-06-293-6/+130
| |\
| | * [MTE] Add a HWASan-style tag dump to tombstones.Mitch Phillips2021-06-283-6/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already dump the tags in the regigster dump section by appending the tag to the memory address. You only get 2 granules before each register and 13 after. The HWASan-style tag dump is extremely useful for debugging, as it gives a pretty comprehensive overview of the memory subsystem. It also provides enough context bytes (256) to give you a reasonable intuition about a particular bug. The tag dump shows up only if PTRACE_PEEKTAGS returns at least one value in the 256 requested. If the start of end of the region is untagged, it's omitted. The tag dump looks like this: Change-Id: Icc33fb97542d9b1fa3ae9e58aba34d524c6ba7b5 --- Memory tags around the fault address (0x60000704414d340), one tag per 16 bytes: 0x704414d000: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d100: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d200: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 =>0x704414d300: 0 0 0 0 [2] 2 0 0 0 0 0 0 0 0 0 0 0x704414d400: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d500: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d600: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d700: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d800: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414d900: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x704414da00: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- Bug: 183992164 Test: atest debuggerd_test on MTE+QEMU and sunfish. Change-Id: I8d5842e4803ca30b407e866c99eef56f2cb36600
| * | Avoid using thread cache in unwinder.yidong zhang2021-06-241-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | Using thread cache will cause SIGSEGV for 32bit+kernel4.9 device. Bug: 190579082 Bug: 189803009 Test: run cts -m CtsSeccompHostTestCases Change-Id: I47b13d02674aadbacd8dac36d8382eed0885413c Signed-off-by: yidong zhang <yidong.zhang@amlogic.com>
| * [MTE] Print cause and alloc/dealloc traces to logcat.Mitch Phillips2021-06-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This information clearly meets the bar for being dumped to logcat. If we omit the info, we may confuse the user into thinking that it's not available at all, especially if it's their first time seeing an MTE report. This also adds some functionality to the integration testing library to pull logcat messages and scan them to make sure the contents are in both places. Bug: 187881237 Test: atest debuggerd_test # on QEMU w/ MTE. Change-Id: Icc17ea45bda7628331cc4812eaad3bc5c949b7a7
| * Update API of MapInfo from libunwindstackDavid Srbecky2021-05-132-27/+27
| | | | | | | | | | | | | | Use accessors to for all the fields. Test: build Change-Id: I68d149d914d4a4b088aaf822fe222a5d9e56ae80
| * Re-add backtrace note about unreadable elf.Christopher Ferris2021-05-032-0/+13
| | | | | | | | | | | | | | | | | | | | | | When moving to the proto-ized tombstones, the note about unreadable elf files in a backtrace got lost. This re-adds it and adds a test to verify that the note properly shows up. Bug: 185428454 Test: Ran unit tests. Change-Id: I1150cc737772e1b79fd73ec5c782caadc4629421
| * Merge "debuggerd: store commandline instead of process name."Josh Gao2021-03-316-16/+35
| |\
| | * debuggerd: store commandline instead of process name.Josh Gao2021-03-306-16/+35
| | | | | | | | | | | | | | | | | | Bug: http://b/180605583 Test: debuggerd_test Change-Id: I018d399a5460f357766dc1b429f645f78fe88565
| * | Adjust libunwindstack MapInfo APIDavid Srbecky2021-03-231-2/+1
| |/ | | | | | | | | Test: m debuggerd_test Change-Id: I63a2379bad3ace4755ae48bf0a83eaa0070f9077
| * Merge "libdebuggerd: store process uptime."Josh Gao2021-03-232-0/+28
| |\
| | * libdebuggerd: store process uptime.Josh Gao2021-03-012-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Application developers would like to know how long their process has been alive for to distinguish between crashes that happen immediately upon startup and crashes in regular operation. Test: manual Change-Id: Ia31eeadfcced358b478c7a7c7bb2e8a0252e30f4
| * | Merge "Support MTE and GWP-ASan features in proto tombstones."Peter Collingbourne2021-03-1910-181/+397
| |\ \
| | * | Support MTE and GWP-ASan features in proto tombstones.Peter Collingbourne2021-03-1610-181/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Proto tombstones were missing tagged fault addresses, tagged_addr_ctrl, tags in memory dumps and Scudo and GWP-ASan error reports. Since text tombstones now go via protos, all of these features broke when we switched to text tombstones generated from protos by default. Fix the features by adding support for them to the proto format, tombstone_proto and tombstone_proto_to_text. Bug: 135772972 Bug: 182489365 Change-Id: I3ca854546c38755b1f6410a1f6198a44d25ed1c5
| * | | Merge "[GWP-ASan] Add debuggerd end-to-end tests and remove unique wording."Peter Collingbourne2021-03-192-13/+4
| |\ \ \
| | * | | [GWP-ASan] Add debuggerd end-to-end tests and remove unique wording.Mitch Phillips2021-03-112-13/+4
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like we unintentionally had a breakage after aosp/1595302, where both GWP-ASan and MTE tests started failing because the extra information wasn't plumbed through the tombstones. MTE has end-to-end tests but aren't run continuously, and GWP-ASan was missing the e2e tests. Also remove some unique wording for GWP-ASan, a UaF on the free'd pointer is now "0 bytes into a 16-byte allocation" instead of "on a 16-byte allocation". The former is more descriptive and is more ubiquitously used in our tooling. This patch adds the E2E tests, but the underlying problem needs to be fixed as well, before this patch can land. Bug: 182489365 Test: atest debuggerd_test Change-Id: I0fe8aba7ea443b3071724987f46b19a6525cda3c
| * / / debuggerd: remove unused file.Elliott Hughes2021-03-161-37/+0
| |/ / | | | | | | | | | | | | Test: treehugger Change-Id: I17f5f88e91be3dccbf01b93ca93b0879a997bb4d
| * | Merge "Teach debuggerd to pass the secondary ring buffer to ↵Peter Collingbourne2021-03-112-2/+5
| |\ \ | | | | | | | | | | | | __scudo_get_error_info()."
| | * | Teach debuggerd to pass the secondary ring buffer to __scudo_get_error_info().Peter Collingbourne2021-02-122-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change we can report memory errors involving secondary allocations. Update the existing crasher tests to also test UAF/overflow/underflow on allocations with sizes sufficient to trigger the secondary allocator. Bug: 135772972 Change-Id: Ic8925c1f18621a8f272e26d5630e5d11d6d34d38
| * | | Merge "Untag addresses in registers before looking up the mapping."Treehugger Robot2021-03-062-2/+4
| |\ \ \ | | |_|/ | |/| |
| | * | Untag addresses in registers before looking up the mapping.Peter Collingbourne2021-02-052-2/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | Otherwise we can fail to find map entries for tagged addresses, such as those of heap objects. Bug: 135772972 Change-Id: Ia626b0587c8461eb575b2de5c08562c73ba4a66e
| * | libdebuggerd: delete unused code.Josh Gao2021-03-011-1/+0
| | | | | | | | | | | | | | | Test: none Change-Id: I87b62f306d287e9356c639f6d0c49566c71f7f29