platform_system_core/debuggerd/libdebuggerd
Mitch Phillips 729e08f6ea [MTE] Add a HWASan-style tag dump to tombstones.
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
Merged-In: I8d5842e4803ca30b407e866c99eef56f2cb36600
2021-06-29 16:17:58 -07:00
..
include/libdebuggerd [MTE] Add a HWASan-style tag dump to tombstones. 2021-06-29 16:17:58 -07:00
test Merge "debuggerd: store commandline instead of process name." 2021-03-31 08:29:54 +00:00
backtrace.cpp debuggerd: store commandline instead of process name. 2021-03-30 12:15:56 -07:00
gwp_asan.cpp Merge "Support MTE and GWP-ASan features in proto tombstones." 2021-03-19 23:42:23 +00:00
open_files_list.cpp libdebuggerd: decode fdsan owner tags. 2018-08-28 13:48:08 -07:00
scudo.cpp Support MTE and GWP-ASan features in proto tombstones. 2021-03-16 10:59:39 -07:00
tombstone.cpp Avoid using thread cache in unwinder. 2021-06-24 20:28:34 +00:00
tombstone_proto.cpp [MTE] Add a HWASan-style tag dump to tombstones. 2021-06-29 16:17:58 -07:00
tombstone_proto_to_text.cpp [MTE] Add a HWASan-style tag dump to tombstones. 2021-06-29 16:17:58 -07:00
utility.cpp Support MTE and GWP-ASan features in proto tombstones. 2021-03-16 10:59:39 -07:00