-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
Here is a vma extracted from the smaps file. It is evident that this particular VMA contains 1942012kB of anonymous memory.
700000000-8003b7000 rw-p 00000000 00:00 0
Size: 4198108 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Rss: 1942012 kB
Pss: 1942012 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 1942012 kB
Referenced: 1942012 kB
Anonymous: 1942012 kB
LazyFree: 0 kB
AnonHugePages: 0 kB
ShmemPmdMapped: 0 kB
Shared_Hugetlb: 0 kB
Private_Hugetlb: 0 kB
Swap: 0 kB
SwapPss: 0 kB
Locked: 0 kB
ProtectionKey: 0
VmFlags: rd wr mr mw me ac sd
Now, using drgn 0.0.24, we can scan each address within this VMA and count the number of addresses that can be successfully accessed.
task = find_task(prog, 2023533)
addr = 0x700000000
count = 0
while addr < 0x8003b7000:
try:
data = access_process_vm(task, addr, 4096)
count += 1
except:
#print(hex(addr))
pass
addr += 4096
print(count)
print(count * 4096 / 1024/1024)
The result indicates a count of 20436, and the total accessible size is 79.828125MB, which is significantly smaller than the actual size.
I don't know how to solve this...
Metadata
Metadata
Assignees
Labels
No labels