[all-commits] [llvm/llvm-project] f26431: [lldb][test] Strip the MTE tag in TestExpeditedRec...
Yao Qi via All-commits
all-commits at lists.llvm.org
Thu Sep 24 13:20:25 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f26431d1e224f1e704fc167c2f509e4221e04220
https://github.com/llvm/llvm-project/commit/f26431d1e224f1e704fc167c2f509e4221e04220
Author: Yao Qi <yao_qi at apple.com>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M lldb/test/API/macosx/expedited-recent-reads/TestExpeditedRecentReads.py
Log Message:
-----------
[lldb][test] Strip the MTE tag in TestExpeditedRecentReads (#226272)
When the inferior runs with MTE enabled, both heap cases in
`TestExpeditedRecentReads.py` fail at their first stop:
```
AssertionError: [] == [] : the first stop should read the heap buffer from the stub; reads: [0x104da8a00,0x104da8c00)
AssertionError: [] == [] : the first stop should read the heap buffer from the stub; reads: [0x1047acb30,0x1047acb38), [0x1047acb30,0x1047acb38), ...
```
lldb did read the heap buffer. `calloc` returns a pointer with an MTE
tag in its top byte, and lldb strips the tag before it reads memory:
```
(lldb) breakpoint set -p "break here" -f main.c
(lldb) process launch --memory-tagging
...
(lldb) frame variable heap
(Payload *) heap = 0x0b000001005b0b30
(lldb) script v = lldb.frame.FindVariable("heap"); print("GetValueAsUnsigned: 0x%x" % v.GetValueAsUnsigned(0)); print("GetValueAsAddress: 0x%x" % v.GetValueAsAddress())
GetValueAsUnsigned: 0xb000001005b0b30
GetValueAsAddress: 0x1005b0b30
```
Reading `heap->values[0]` then sends `x1005b0a00,200`, which reads the
untagged address. `heap_range` takes the address from
`GetValueAsUnsigned`, which keeps the tag, so `covering` never matches
a read. Use `GetValueAsAddress`, which returns the address with the
non-addressable bits cleared.
Assisted-by: claude
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list