From 615ccf98cf82f649851a37d37eb5e58d6d17bb53 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Fri, 5 Jul 2024 08:22:55 +0000 Subject: [PATCH] crit: do not crash on aarch64 doing 'crit x ./ rss' Running 'crit x ./ rss' on aarch64 crashes with: File "/home/criu/crit/crit/__main__.py", line 331, in explore_rss while vmas[vmi]['start'] < pme: ~~~~^^^^^ IndexError: list index out of range This adds an additional check to the while loop to do access indexes out of range. Signed-off-by: Adrian Reber --- crit/crit/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crit/crit/__main__.py b/crit/crit/__main__.py index e15327f50..bce523445 100755 --- a/crit/crit/__main__.py +++ b/crit/crit/__main__.py @@ -323,12 +323,12 @@ def explore_rss(opts): pvmi = -1 for pm in pms[1:]: pstr = '\t%lx / %-8d' % (pm['vaddr'], pm['nr_pages']) - while vmas[vmi]['end'] <= pm['vaddr']: + while vmi < len(vmas) and vmas[vmi]['end'] <= pm['vaddr']: vmi += 1 pme = pm['vaddr'] + (pm['nr_pages'] << 12) vstr = '' - while vmas[vmi]['start'] < pme: + while vmi < len(vmas) and vmas[vmi]['start'] < pme: vma = vmas[vmi] if vmi == pvmi: vstr += ' ~'