[CRIU] File size is not same on restore

Tycho Andersen tycho.andersen at canonical.com
Mon Nov 9 06:49:24 PST 2015


On Sun, Nov 08, 2015 at 10:45:09AM +0900, 上司陽平 wrote:
> Hi, I have an error and want to help me.
> I succeeded to dump a lxc container but I can't restore it.
> 
> A log of restore has following error messages:
> (00.200896)    146: Error (files-reg.c:1078): File
> lib/x86_64-linux-gnu/libcgmanager.so.0.0.0 has bad size 137024 (expect
> 108480)
> (00.200902)    258:     pr2 Read page 7f79620bf000 from self
> 7f79620bf000/4f000
> (00.200906)    146: Error (cr-restore.c:257): Can't fixup VMA's fd
> 
> I checked a status on host OS,
> $ stat /var/lib/lxc/u1/rootfs/lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
> This file's size is 108480.
> Then I checked stat on the lxc container
> $ stat /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
> This file's size is 108480, it is same!!
> 
> Therefore I injected debug print at the dump_one_reg_file function in
> files-reg.c.
> 
> if (S_ISREG(p->stat.st_mode) && should_check_size(rfe.flags)) {
>                 rfe.has_size = true;
>                 rfe.size = p->stat.st_size;
>                 pr_debug("Debug: %s has %"PRIu64"\n", rfe.name, rfe.size);
> }
> 
> This printed in the log of dump,
> (00.113142) Debug: /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0 has 108480
> 
> I think that size information of an open file is stored to an image file
> after this checking.
> However this size is not same on restore.
> 
> ENV is following:
> uname -a ->
> Linux uhoi 4.2.5 #1 SMP Wed Oct 28 14:39:35 JST 2015 x86_64 x86_64 x86_64
> GNU/Linux
> criu -V ->
> Version: 1.7.2
> GitID: v1.7-17-g2bf517e
> 
> Someone please tell me how to resolve these errors.
> Appreciate your helping hands.

How are you restoring it? If not via lxc-checkpoint, are you
remembering to pass --root?

Tycho


More information about the CRIU mailing list