Skip to content

Commit 615ccf9

Browse files
adrianreberavagin
authored andcommitted
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 <[email protected]>
1 parent 21ea718 commit 615ccf9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crit/crit/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ def explore_rss(opts):
323323
pvmi = -1
324324
for pm in pms[1:]:
325325
pstr = '\t%lx / %-8d' % (pm['vaddr'], pm['nr_pages'])
326-
while vmas[vmi]['end'] <= pm['vaddr']:
326+
while vmi < len(vmas) and vmas[vmi]['end'] <= pm['vaddr']:
327327
vmi += 1
328328

329329
pme = pm['vaddr'] + (pm['nr_pages'] << 12)
330330
vstr = ''
331-
while vmas[vmi]['start'] < pme:
331+
while vmi < len(vmas) and vmas[vmi]['start'] < pme:
332332
vma = vmas[vmi]
333333
if vmi == pvmi:
334334
vstr += ' ~'

0 commit comments

Comments
 (0)