Skip to content
Snippets Groups Projects
Commit 1f93ecad authored by Laura Abbott's avatar Laura Abbott
Browse files

linux-ramdump-parser-v2: Check for cycles in pagetypeinfo

Because pages are constantly being allocated and freed, the pagetypeinfo
may not be in a consistent state when dumps are collected. Check
to make sure there are no cycles in the list for more than just the
next item.

Change-Id: Ie986bbb78f39923dbe11ef0446912518bc6c7fc5
parent 4eb3aa20
No related branches found
No related tags found
No related merge requests found
......@@ -47,17 +47,18 @@ class Pagetypeinfo(RamParser):
curr = orig_free_list
pg_count = -1
first = True
seen = []
while True:
pg_count = pg_count + 1
seen.append(curr)
next_p = ramdump.read_word(curr)
if next_p == curr:
if not first:
is_corrupt = True
break
first = False
curr = next_p
if curr == orig_free_list:
break
if next_p in seen:
is_corrupt = True
break
nums = nums + ('{0:6}'.format(pg_count))
total_type_bytes = total_type_bytes + \
pg_count * 4096 * (2 ** order)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment