[CRIU] Error in dump parent process, with child process in different namespace

Hui Kang hkang.sunysb at gmail.com
Thu Jul 30 08:57:54 PDT 2015


Hi,
I have a program that will create a child with its own pid and net
namespace. The program looks like this

int main()
{

  int child_pid = clone(child_main, child_stack+STACK_SIZE,
                        CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWPID |
CLONE_NEWNS | CLONE_NEWNET | SIGCHLD, NULL);

    asprintf(&cmd, "ip link set veth101 netns %d", child_pid);
    system("ip link add veth100 type veth peer name veth101");
    system(cmd);
    system("ip link set veth100 up");
    system("ip addr add 169.254.2.1/30 dev veth100");

     waitpid(child_pid, NULL, 0);
}

int child_main(void* arg)
{

  // setup
network

  system("ip link set lo up");
  system("ip link set veth101 up");
  system("ip addr add 169.254.2.2/30 dev veth101");

  printf(" - [%s] Child exec !\n", child_args[0]);
  execv(child_args[0], child_args);
}

For example, when I start the program, the parent PID will be 28078 and the
child pid is 28080. I can alway verify that they are in different pid and
net namespace. In addition, the veth are connected.

Then I tried using criu to checkpoint the parent proces by

    $ criu dump --tree 28078 -vvvv

It gives me these error

(00.000032) Probing sock diag modules
(00.000221) Done probing
(00.000278) ========================================
(00.000320) Dumping processes (pid: 28078)
(00.000359) ========================================
(00.000521) Found anon-shmem device at 4
(00.000577) Reset 28192's dirty tracking
(00.000688)  ... done
(00.000782) Dirty track supported on kernel
(00.000988) irmap: Searching irmap cache in work dir
(00.001050) No irmap-cache image
(00.001296) irmap: Searching irmap cache in parent
(00.001351) irmap: No irmap cache
(00.001404) cpu: fpu:1 fxsr:1 xsave:0
(00.001621) vdso: Parsing at 7fff251cf000 7fff251d1000
(00.001674) vdso: PT_LOAD p_vaddr: ffffffffff700000
(00.001718) vdso: DT_HASH: 0xffffffffff700120
(00.001772) vdso: DT_STRTAB: 0xffffffffff700268
(00.001834) vdso: DT_SYMTAB: 0xffffffffff700160
(00.001871) vdso: DT_STRSZ: 94
(00.001910) vdso: DT_SYMENT: 24
(00.001948) vdso: nbucket 3 nchain 11 bucket 0x7fff251cf128 chain
0x7fff251cf134
(00.002031) vdso: rt [vdso] 7fff251cf000-7fff251d1000 [vvar]
ffffffffffffffff-ffffffffffffffff
(00.002206) Writing image inventory (version 1)
(00.002290) Add pid ns 1 pid 28192
(00.002329) Add net ns 2 pid 28192
(00.002362) Add ipc ns 3 pid 28192
(00.002394) Add uts ns 4 pid 28192
(00.002440) Add mnt ns 5 pid 28192
(00.002492) Add user ns 6 pid 28192
(00.002536) cg: Dumping cgroups for 28192
(00.002748) cg:  `- New css ID 1
(00.002794) cg:     `- [blkio] -> [/]
(00.002831) cg:     `- [cpu] -> [/]
(00.002944) cg:     `- [cpuacct] -> [/]
(00.002972) cg:     `- [cpuset] -> [/]
(00.002996) cg:     `- [devices] -> [/]
(00.003020) cg:     `- [freezer] -> [/]
(00.003068) cg:     `- [hugetlb] -> [/]
(00.003105) cg:     `- [memory] -> [/]
(00.003164) cg:     `- [name=systemd] -> [/]
(00.003219) cg:     `- [perf_event] -> [/]
(00.003256) cg: Set 1 is criu one
(00.003819) Seized task 28078, state 1
(00.004022) Seized task 28080, state 0
(00.004436) Collected 28080 in 1 state
(00.004595) Collected 28078 in 1 state
(00.004681) Error (namespaces.c:247): Can't dump nested pid namespace for
28080
(00.004713) Error (namespaces.c:443): Can't make pidns id
(00.004742) Unlock network
(00.004772) Unfreezing tasks into 1
(00.004799)     Unseizing 28078 into 1
(00.004911)     Unseizing 28080 into 1
(00.005083) Error (cr-dump.c:1957): Dumping FAILED.

Can anyone help? Thanks in advance.

- Hui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150730/fc9627d8/attachment.html>


More information about the CRIU mailing list