tests: Ignore large memory blocks when searching for keys

wpa_supplicant will generally never allocate a memory block of that
size. We can therefore assume that it belongs to ASAN and we need to
ignore it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
This commit is contained in:
Benjamin Berg 2024-06-14 10:13:51 +02:00 committed by Jouni Malinen
parent 58b2759551
commit 7f3fe956d8

View file

@ -2658,6 +2658,11 @@ def read_process_memory(pid, key=None):
for name in ["[heap]", "[stack]"]:
if name in l:
logger.info("%s 0x%x-0x%x is at %d-%d" % (name, start, end, len(buf), len(buf) + (end - start)))
if end - start >= 256 * 1024 * 1024:
logger.info("Large memory block of >= 256MiB, assuming ASAN shadow memory")
continue
try:
mem.seek(start)
data = mem.read(end - start)