[CRIU] [PATCH] net/ip: print fd link of the image we fail to restore from

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Aug 7 15:52:02 MSK 2018


https://travis-ci.org/criupatchwork/criu/jobs/412519099

========================= Run zdtm/static/env00 in ns ==========================
Start test
./env00 --pidfile=env00.pid --outfile=env00.out --envname=ENV_00_TEST
Run criu dump
Run criu restore
Fail RESTORE failed: Error(0): Unknown
=[log]=> dump/zdtm/static/env00/85/1/restore.log
------------------------ grep Error ------------------------
(00.000075) Version: 3.10 (gitid 49f7e07)
(00.000143) Running on travis-job-8a974ebb-7c8c-4133-9e93-c9f803cae02c Linux 4.4.0-51-generic #72~14.04.1-Ubuntu SMP Thu Nov 24 19:22:30 UTC 2016 x86_64
profiling:/home/travis/build/criupatchwork/criu/criu/cr-dump.gcda:Merge mismatch for function 45
Magic mismatch (1 elems, 666f7270 magic)
     1: Error (criu/util.c:834): exited, status=255
     1: Error (criu/net.c:1730): IP tool failed on addr restore
     1: Error (criu/util.c:1535): Can't wait or bad status: errno=0, status=65280
(00.000143) Error (criu/mount.c:3273): mnt: Can't remove the directory /tmp/.criu.mntns.WR0uSi: No such file or directory
(00.000143) Error (criu/cr-restore.c:2308): Restoring FAILED.
------------------------ ERROR OVER ------------------------

These "ip addr restore < some_ip_addr_dump.img" fails because wrong
magic in image, it is 0x666f7270 but should be 0x47361222, may be we
somehow gave the wrong file to ip util?

Moreover we have same error with same wrong magic for other series:
https://travis-ci.org/criupatchwork/criu/jobs/409952785, but for me it
does not reproduce in 4 runs in travis, so add more info about the
image.

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 criu/net.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/criu/net.c b/criu/net.c
index cbd03dd0a..d8944bc43 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -1726,8 +1726,14 @@ static int run_ip_tool(char *arg1, char *arg2, char *arg3, char *arg4, int fdin,
 	ret = cr_system(fdin, fdout, -1, ip_tool_cmd,
 				(char *[]) { "ip", arg1, arg2, arg3, arg4, NULL }, flags);
 	if (ret) {
-		if (!(flags & CRS_CAN_FAIL))
+		if (!(flags & CRS_CAN_FAIL)) {
+			char buf[PATH_MAX];
+
 			pr_err("IP tool failed on %s %s %s %s\n", arg1, arg2, arg3 ? : "\0", arg4 ? : "\0");
+			if (!strcmp(arg2, "restore")
+			    && read_fd_link(fdin, buf, sizeof(buf)) >= 0)
+				pr_err("failed restore from image %s\n", buf);
+		}
 		return -1;
 	}
 
-- 
2.17.1



More information about the CRIU mailing list