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

Massive testsuite failures when testing from a subdirectory of /tmp on Fedora (starting with zdtm/static/aio00) #2441

Closed
fweimer-rh opened this issue Jul 10, 2024 · 7 comments · Fixed by #2445
Assignees

Comments

@fweimer-rh
Copy link
Contributor

Fedora 39 mounts /tmp like this:

tmpfs on /tmp type tmpfs (rw,nosuid,nodev,seclabel,nr_inodes=1048576,inode64)

This seems to cause all tests to fail if the CRIU Git checkout is located in /tmp. It's a bit non-obvious, so maybe the testsuite could check the mount flags of the mount point? At the very least, this ticket should be easier to find due to the zdtm/static/aio00 string …

avagin added a commit to avagin/criu that referenced this issue Jul 10, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
@avagin
Copy link
Member

avagin commented Jul 10, 2024

Our tests creates a test root file system to run tests in a container-like environment:
https://github.com/checkpoint-restore/criu/blob/criu-dev/test/zdtm.py#L251

We probably can do something like this:
avagin@0e477f3

@adrianreber could you try to run these tests with my patch?

@avagin
Copy link
Member

avagin commented Jul 11, 2024

@adrianreber I just found that my change is incomplete. I will update it and push the new version tomorrow.

@avagin
Copy link
Member

avagin commented Jul 12, 2024

My origin idea doesn't work. I think the simplest way to fix the issue is to do something like this:

index 56fc8ec..45b1d3e 100755
--- a/tests/run-zdtm.sh
+++ b/tests/run-zdtm.sh
@@ -24,7 +24,7 @@ EXCLUDES=" \
        -x zdtm/static/cgroup02 "
 
 run_test() {
-       ./zdtm.py run --criu-bin /usr/sbin/criu ${EXCLUDES} \
+       ./test/zdtm.py run --criu-bin /usr/sbin/criu ${EXCLUDES} \
                -a --ignore-taint --keep-going
 
        RESULT=$?
@@ -42,11 +42,14 @@ rm -f /var/lib/sss/pipes/nss
 
 cd source
 
+tar -czf test.tar.gz -C test .
+mount -t tmpfs criu-test test
+trap "umount -l test" EXIT
+tar -xzf test.tar.gz -C test
+
 echo "Build CRIU"
 make
 
-cd test
-
 echo "Run the actual CRIU test suite"
 run_test

@rst0git
Copy link
Member

rst0git commented Jul 12, 2024

maybe the testsuite could check the mount flags of the mount point?

It sounds like a good idea.

I think the simplest way to fix the issue is to do something like this

@avagin Would it make sense for ZDTM to exit with an error message describing the problem?

avagin added a commit to avagin/criu that referenced this issue Jul 12, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 13, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 13, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 13, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
@Snorch
Copy link
Member

Snorch commented Jul 15, 2024

This seems to cause all tests to fail if the CRIU Git checkout is located in /tmp.

Without any logs of failure there is no way to confirm that what you are describing is the same to what others may experience. Can you please follow the Issue creation template, and **CRIU logs and information:** specifically when reporting issues?

I'd assume the error we are talking about is:

========================= Run zdtm/static/aio00 in ns ==========================
Start test
./aio00 --pidfile=aio00.pid --outfile=aio00.out
The test failed (0, 1)
make: *** [Makefile:496: aio00.pid] Error 1
 Test zdtm/static/aio00 FAIL at ['make', '--no-print-directory', '-C', 'zdtm/static', 'aio00.pid'] 
##################################### FAIL #####################################

cat test/zdtm/static/aio00.outns 
02:40:53.489:     1: ERR: test.c:103: Can't open /dev/null (errno = 13 (Permission denied))

Snorch added a commit to Snorch/criu that referenced this issue Jul 15, 2024
We put several device files into zdtm container through its root
file system which is the same file system criu git resides in.

We do it like this to overcome inability to create character and block
device files in user namespaces. So even if we put those device files
into zdtm container in any other way, in 'uns' flavor CRIU would not be
able to restore those device files.

Other option can be - creating auxiliary tmpfs mount and add it into
zdtm container as external mount, but that looks like an overkill for
this problem. Let's print a clear error so that user can either mount
current file system without 'nodev" or put criu somewhere else.

Fixes: checkpoint-restore#2441

Signed-off-by: Pavel Tikhomirov <[email protected]>
@Snorch
Copy link
Member

Snorch commented Jul 15, 2024

I agree with @rst0git, it seems like to much an effort to use external mount to provide device files into zdtm container.

Let's just print clear message that 'nodev' is a no-go option for criu repo if you want to run zdtm: #2444

Snorch added a commit to Snorch/criu that referenced this issue Jul 15, 2024
We put several device files into zdtm container through its root
file system which is the same file system criu git resides in.

We do it like this to overcome inability to create character and block
device files in user namespaces. So even if we put those device files
into zdtm container in any other way, in 'uns' flavor CRIU would not be
able to restore those device files.

Other option can be - creating auxiliary tmpfs mount and add it into
zdtm container as external mount, but that looks like an overkill for
this problem. Let's print a clear error so that user can either mount
current file system without 'nodev" or put criu somewhere else.

Fixes: checkpoint-restore#2441

Signed-off-by: Pavel Tikhomirov <[email protected]>
@Snorch
Copy link
Member

Snorch commented Jul 16, 2024

We've talked with @avagin yesterday, and came to the conclusion that we probably should go with Andrei's "external mount" approach (avagin@38bab46), as the tendency is to add nodev to every filesystem except devtmpfs, and sooner or later we will face the problem that all available filesystems have it. So I'm closing my "just print clear message" PR in favor of Andrei's patch.

avagin added a commit to avagin/criu that referenced this issue Jul 19, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 19, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 20, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 20, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit to avagin/criu that referenced this issue Jul 21, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
@avagin avagin closed this as completed in 93746eb Jul 22, 2024
avagin added a commit to avagin/criu that referenced this issue Aug 16, 2024
The current file system can be mounted with nodev.

Fixes checkpoint-restore#2441

Signed-off-by: Andrei Vagin <[email protected]>
avagin added a commit that referenced this issue Sep 11, 2024
The current file system can be mounted with nodev.

Fixes #2441

Signed-off-by: Andrei Vagin <[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
5 participants