Skip to content

Conversation

@alam0rt
Copy link
Contributor

@alam0rt alam0rt commented Oct 31, 2025

Noticed that coredump was blowing up when constructing a coredump from a checkpoint (arm64).

Traceback (most recent call last):
  File "/home/ubuntu_ssm_sudo/checkpoint/checkpoint/../../criu/coredump/coredump", line 55, in <module>
    main()
  File "/home/ubuntu_ssm_sudo/checkpoint/checkpoint/../../criu/coredump/coredump", line 47, in main
    coredump(opts)
  File "/home/ubuntu_ssm_sudo/checkpoint/checkpoint/../../criu/coredump/coredump", line 14, in coredump
    cores = generator(os.path.realpath(opts['in']))
  File "/home/ubuntu_ssm_sudo/criu/coredump/criu_coredump/coredump.py", line 192, in __call__
    self.coredumps[pid] = self._gen_coredump(pid)
  File "/home/ubuntu_ssm_sudo/criu/coredump/criu_coredump/coredump.py", line 214, in _gen_coredump
    cd.vmas = self._gen_vmas(pid)
  File "/home/ubuntu_ssm_sudo/criu/coredump/criu_coredump/coredump.py", line 991, in _gen_vmas
    v.data = self._gen_mem_chunk(pid, vma, v.filesz)
  File "/home/ubuntu_ssm_sudo/criu/coredump/criu_coredump/coredump.py", line 878, in _gen_mem_chunk
    page_mem = self._get_page(pid, page_no)
  File "/home/ubuntu_ssm_sudo/criu/coredump/criu_coredump/coredump.py", line 797, in _get_page
    for i in range(m["nr_pages"]):
KeyError: 'nr_pages'

Since the pagemap contained compat_nr_pages instead of nr_pages, I've added a fallback to use that instead.

E.g., dict contained the below

{'vaddr': 281474652319744, 'compat_nr_pages': 2, 'flags': 6}

@alam0rt alam0rt force-pushed the fallback-to-compat-nr-pages branch from 3a3683b to 41ad20a Compare October 31, 2025 03:43
@avagin
Copy link
Member

avagin commented Oct 31, 2025

LGTM: Please add the "coredump: " prefix to the subject.

@alam0rt alam0rt changed the title fallback to 32bit pages if available coredump: use required compat_nr_pages over nr_pages Oct 31, 2025
@alam0rt alam0rt changed the title coredump: use required compat_nr_pages over nr_pages coredump: use required compat_nr_pages as fallback for nr_pages Nov 2, 2025
Use nr_pages when available, falling back to compat_nr_pages
for compatibility.

Signed-off-by: alam0rt <sam@samlockart.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
@rst0git rst0git force-pushed the fallback-to-compat-nr-pages branch from f0ebe33 to a058ff0 Compare November 3, 2025 00:51
Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@avagin avagin merged commit e879d69 into checkpoint-restore:criu-dev Nov 3, 2025
25 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants