Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAGEMAP_SCAN: Invalid argument #2334

Closed
rst0git opened this issue Jan 21, 2024 · 3 comments · Fixed by #2349
Closed

PAGEMAP_SCAN: Invalid argument #2334

rst0git opened this issue Jan 21, 2024 · 3 comments · Fixed by #2349

Comments

@rst0git
Copy link
Member

rst0git commented Jan 21, 2024

$ uname -a
Linux thinkpad 6.7.0-68.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan  8 14:53:36 UTC 2024 x86_64 GNU/Linux
$ sudo criu check --feature pagemap_scan
pagemap_scan is supported
sudo ./zdtm.py run -t zdtm/static/busyloop00
userns is supported
=== Run 1/1 ================ zdtm/static/busyloop00
====================== Run zdtm/static/busyloop00 in uns =======================
Construct root for zdtm/static/busyloop00
Start test
./busyloop00 --pidfile=busyloop00.pid --outfile=busyloop00.out
Run criu dump
=[log]=> dump/zdtm/static/busyloop00/63/1/dump.log
------------------------ grep Error ------------------------
b'(00.010991) pagemap-cache: \t63:           405000-407000           nr:3     cov:28672'
b'(00.010992) pagemap-cache: \t63:           407000-408000           nr:4     cov:32768'
b'(00.010994) pagemap-cache: \t63:           408000-409000           nr:5     cov:36864'
b'(00.010995) pagemap-cache: \t63: cache  mode [l:400000 h:600000]'
b'(00.011001) Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
b'(00.011003) Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'
b'(00.011010) page-pipe: Killing page pipe'
b'(00.011015) ----------------------------------------'
b"(00.011016) Error (criu/mem.c:672): Can't dump page with parasite"
b'(00.025728) Running network-unlock scripts'
b'(00.073385) Unfreezing tasks into 1'
b'(00.073413) \tUnseizing 63 into 1'
b'(00.073422) \tUnseizing 66 into 1'
b'(00.073449) Error (criu/cr-dump.c:2098): Dumping FAILED.'
------------------------ ERROR OVER ------------------------
################ Test zdtm/static/busyloop00 FAIL at CRIU dump #################
Test output: ================================

 <<< ================================
Send the 9 signal to  63
Wait for zdtm/static/busyloop00(63) to die for 0.100000
##################################### FAIL #####################################
@rst0git
Copy link
Member Author

rst0git commented Jan 21, 2024

cc: @avagin

The test is passing with the following change:

diff --git a/criu/pagemap-cache.c b/criu/pagemap-cache.c
index 978a6b1ac..a0f94683c 100644
--- a/criu/pagemap-cache.c
+++ b/criu/pagemap-cache.c
@@ -190,7 +190,7 @@ int pmc_fill(pmc_t *pmc, u64 start, u64 end)
                        .category_inverted = PAGE_IS_PFNZERO | PAGE_IS_FILE,
                        .category_mask = PAGE_IS_PFNZERO | PAGE_IS_FILE,
                        .category_anyof_mask = PAGE_IS_PRESENT | PAGE_IS_SWAPPED,
-                       .return_mask = PAGE_IS_PRESENT | PAGE_IS_SWAPPED | PAGE_IS_SOFT_DIRTY,
+                       .return_mask = PAGE_IS_PRESENT | PAGE_IS_SWAPPED,
                };
                long ret;
 

@avagin
Copy link
Member

avagin commented Jan 23, 2024

git describe --contains e6a9a2cbc13bf
v6.8-rc1~180^2~344

I didn't expect that it hadn't been merged in 6.7...

rst0git added a commit to rst0git/criu that referenced this issue Feb 13, 2024
The commit introducing PAGE_IS_SOFT_DIRTY has not been merged
in kernel v6.7.x.

fs/proc/task_mmu: report SOFT_DIRTY bits through the PAGEMAP_SCAN ioctl
torvalds/linux@e6a9a2cbc13bf

As a result, CRIU fails with the following error:

Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'

This patch updates check_pagemap() in kerndat to check if PAGE_IS_SOFT_DIRTY is supported.
Fixes: checkpoint-restore#2334

Signed-off-by: Radostin Stoyanov <[email protected]>
rst0git added a commit to rst0git/criu that referenced this issue Feb 13, 2024
The commit introducing PAGE_IS_SOFT_DIRTY has not been merged
in kernel v6.7.x.

fs/proc/task_mmu: report SOFT_DIRTY bits through the PAGEMAP_SCAN ioctl
torvalds/linux@e6a9a2cbc13bf

As a result, CRIU fails with the following error:

Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'

This patch updates check_pagemap() in kerndat to check if PAGE_IS_SOFT_DIRTY is supported.
Fixes: checkpoint-restore#2334

Signed-off-by: Radostin Stoyanov <[email protected]>
@rst0git
Copy link
Member Author

rst0git commented Feb 13, 2024

@avagin This error now appears in Fedora 39 with the following kernel

$ uname -a
Linux thinkpad 6.7.4-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Feb  5 22:21:14 UTC 2024 x86_64 GNU/Linux

The CI tests in Cirrus are also failing: https://github.com/checkpoint-restore/criu/runs/21483877546

I've opened the following pull request: #2349

avagin pushed a commit that referenced this issue Feb 13, 2024
The commit introducing PAGE_IS_SOFT_DIRTY has not been merged
in kernel v6.7.x.

fs/proc/task_mmu: report SOFT_DIRTY bits through the PAGEMAP_SCAN ioctl
torvalds/linux@e6a9a2cbc13bf

As a result, CRIU fails with the following error:

Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'

This patch updates check_pagemap() in kerndat to check if PAGE_IS_SOFT_DIRTY is supported.
Fixes: #2334

Signed-off-by: Radostin Stoyanov <[email protected]>
avagin pushed a commit to avagin/criu that referenced this issue Aug 16, 2024
The commit introducing PAGE_IS_SOFT_DIRTY has not been merged
in kernel v6.7.x.

fs/proc/task_mmu: report SOFT_DIRTY bits through the PAGEMAP_SCAN ioctl
torvalds/linux@e6a9a2cbc13bf

As a result, CRIU fails with the following error:

Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'

This patch updates check_pagemap() in kerndat to check if PAGE_IS_SOFT_DIRTY is supported.
Fixes: checkpoint-restore#2334

Signed-off-by: Radostin Stoyanov <[email protected]>
avagin pushed a commit that referenced this issue Sep 11, 2024
The commit introducing PAGE_IS_SOFT_DIRTY has not been merged
in kernel v6.7.x.

fs/proc/task_mmu: report SOFT_DIRTY bits through the PAGEMAP_SCAN ioctl
torvalds/linux@e6a9a2cbc13bf

As a result, CRIU fails with the following error:

Error (criu/pagemap-cache.c:199): pagemap-cache: PAGEMAP_SCAN: Invalid argument'
Error (criu/pagemap-cache.c:225): pagemap-cache: Failed to fill cache for 63 (400000-402000)'

This patch updates check_pagemap() in kerndat to check if PAGE_IS_SOFT_DIRTY is supported.
Fixes: #2334

Signed-off-by: Radostin Stoyanov <[email protected]>
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 a pull request may close this issue.

2 participants