diff options
| author | Peter Collingbourne <pcc@google.com> | 2020-07-17 14:49:31 -0700 |
|---|---|---|
| committer | Peter Collingbourne <pcc@google.com> | 2020-07-17 17:35:49 -0700 |
| commit | 321c1d2b55aad77cf9619876bbd134f6f7af6874 (patch) | |
| tree | a39bf752d803fba06954feb6e9bbafd54a346bc2 /debuggerd/libdebuggerd/utility.cpp | |
| parent | 78ee9b9eb10babcf1981a9e44a25cd9e9a9fd66c (diff) | |
Fix dumping of heap memory.
After r.android.com/1288984 we started failing to dump memory contents
for heap addresses because the tag started causing any addresses to
fail this bounds check. Add an untag_address() call to the bounds check
so that the tag is ignored.
Bug: 154272452
Change-Id: I3a6d1a078b21871bd93164150a123549f83289f6
Diffstat (limited to 'debuggerd/libdebuggerd/utility.cpp')
| -rw-r--r-- | debuggerd/libdebuggerd/utility.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp index c8a3431b70..0a491bbf6b 100644 --- a/debuggerd/libdebuggerd/utility.cpp +++ b/debuggerd/libdebuggerd/utility.cpp @@ -135,6 +135,10 @@ void dump_memory(log_t* log, unwindstack::Memory* memory, uint64_t addr, const s addr -= 32; } + // We don't want the address tag to interfere with the bounds check below or appear in the + // addresses in the memory dump. + addr = untag_address(addr); + // Don't bother if the address looks too low, or looks too high. if (addr < 4096 || #if defined(__LP64__) |
