[CRIU] problem restoring process with alternate rootfs

Tycho Andersen tycho.andersen at canonical.com
Thu Jul 10 06:34:30 PDT 2014


Hi Pavel,

Thanks for the response.

On Thu, Jul 10, 2014 at 01:26:26PM +0400, Pavel Emelyanov wrote:
> On 07/10/2014 05:56 AM, Tycho Andersen wrote:
> > Hi all,
> > 
> > I'm having a problem restoring a process with an alternate root mount.
> > It has a /proc/$pid/mountinfo entry like:
> > 
> > 66 40 253:1 /var/lib/lxc/u1/rootfs / rw,relatime - ext4 /dev/disk/by-uuid/86de4daf-7810-4422-804f-d1ab23ffd9fa rw,data=ordered
> > 
> > and when I try to restore it I get:
> > 
> > Error (files-reg.c:748): File /lib/x86_64-linux-gnu/libjson-c.so.2.0.0 has bad size 43464 (expect 39328)
> 
> Wow, what a useful sanity check it appears to be! :)

Indeed :)

> > libjson is 43k on my host and 39k in the lxc rootfs, so it seems criu
> > is trying to mmap the host's libjson instead of the container's. I'm
> > not entirely clear on what the bug is here, though; it looks like
> > __mntns_get_root_fd is looking at /proc/$pid/root, which for the
> > container process is just a link to /. I guess something about this /
> > remapping needs to be saved, but I'm not entirely sure what the right
> > approach is.
> > 
> > Thoughts?
> 
> What's the command you use for restore? In case tasks live in mount namespace
> _and_ chroot (well, pivot_root) the --root option should be used to tell criu
> where it is.

My restore command is:

./criu restore \
    -D dump/ \
    -vvvvvv \
    --file-locks \
    --action-script "/home/ubuntu/criu/test/app-emu/lxc/network-script.sh"   \
    -n net -n mnt -n ipc -n pid \
    --tcp-established \
    --root /var/lib/lxc/u1/rootfs \

and now with --root I get:

(00.266014)      1: Path `/var/lib/lxc/u1/rootfs' resolved to `./' mountpoint
(00.266017)      1: Error (mount.c:1953): New root and old root are the same

which I also don't understand :(

Thanks,

Tycho


More information about the CRIU mailing list