-
Notifications
You must be signed in to change notification settings - Fork 684
Description
Hi team
In my application, two child processes are created under a single parent, and each process is launched based on input arguments. Both child processes share almost the same memory layout, with only minor variations.
When using a single child process, the CRIU dump and restore operations work successfully. However, when both child processes are active, only the first-launched child is successfully restored. Attempting to restore the second child results in a “PID already exists” error.
My query is related to how CRIU manages real PIDs and virtual PIDs during the restore process and where it is decided to create the process with this pid specifically, which part of the clone3() system call logic determines that a process with a given PID should be created?
I have attached the logs below , kindly help to resolve this issue.
(00.229236) Collected [usr/lib/libc.so.6] ID 0x37
(00.229776) Collected [usr/lib/libgcc_s.so.1] ID 0x38
(00.230088) Collected [usr/lib/libstdc++.so.6.0.32] ID 0x39
(00.230386) Collected [usr/lib/libQt5Core.so.5.12.12] ID 0x3a
(00.230680) Collected [usr/lib/libQt5Qml.so.5.12.12] ID 0x3b
(00.230978) Collected [usr/lib/libQt5Gui.so.5.12.12] ID 0x3c
(00.231272) Collected [usr/lib/libQt5Quick.so.5.12.12] ID 0x3d
(00.231568) Collected [usr/lib/libwebos-platform-interface.so.1.0.0] ID 0x3e
(00.231870) Collected [usr/lib/libPmLogLib.so.3.3.0] ID 0x3f
(00.232158) Collected [usr/lib/libpbnjson_c.so.2.15.0] ID 0x40
(00.232448) Collected [usr/lib/libpbnjson_cpp.so.2.15.0] ID 0x41
(00.232768) Collected [usr/lib/libluna-service2.so.3.21.2] ID 0x42
(00.233056) Collected [usr/lib/libglib-2.0.so.0.7800.6] ID 0x43
(00.233348) Collected [usr/lib/libiepgshare.so.1.0.0] ID 0x44
(00.233864) Collected [usr/lib/libsnapshot-boot.so.1.2.0] ID 0x45
(00.234174) Collected [usr/lib/libSegFault.so] ID 0x46
(00.234472) Collected [usr/lib/ld-linux.so.3] ID 0x47
(00.237882) Collected [dev/null] ID 0x48
(00.238698) Collected [dev/shm/pmloglib.lock] ID 0x49
(00.239020) Collected [dev/urandom] ID 0x4a
(00.239302) Collected [var/log/inputcommon] ID 0x4b
(00.240330) unix: - Got id 0x4c ino 183412 type SOCK_SEQPACKET state TCP_CLOSE peer 0 (name - dir -) (00.241006) eventfd: Collected : id 0x00004d flags 0x802 counter 0x0000000000002e (00.241386) eventfd: Collected : id 0x00004f flags 0x802 counter 0000000000000000 (00.241732) Collected [tmp/checkpoint/com.webos.app.inputcommon] ID 0x50 (00.242034) Collected [dev/kmsg] ID 0x51 (00.242308) Collected [.] ID 0x52 (00.242586) Collected [.] ID 0x53 (00.243498) unix: - Got id 0x54 ino 2915 type SOCK_DGRAM state TCP_LISTEN peer 0 (name /dev/log dir -)
(00.244162) unix: - Got id 0x4e ino 181900 type SOCK_DGRAM state TCP_ESTABLISHED peer 2915 (name - dir -) (00.244722) - ... done
(00.244928) Collecting 46/69 (flags 0)
(00.246078) No remap-fpath.img image
(00.246344) `- ... done
(00.246916) No apparmor.img image
(00.247590) No cgroup.img image
(00.250268) Running pre-restore scripts
(00.251832) No pidns-1.img image
(00.258828) Forking task with 12375 pid (flags 0x8000)
(00.259120) Before cloning
(00.259260) Inside clone3 Pid : 12375 clone flags : 8000
(00.259434) CA args data req type : 2 pg id : 12375 sid : 12375 born_id -1 state : 1 stop_signo -1 real : -1 virt : 12375
(00.259722) Creating process using clone3()
(00.259868) Before syscall for clone3 pid : 12375
(00.260004) flags=32768 pidfd=0 child_tid=0 parent_tid=0 exit_signal=0 stack=0 stack_size=0 tls=0 set_tid=4292638160 set_tid_size=1
(00.301446) Error in clone 3 PID : -1 tid : 0
(00.302378) PID real : -1 , virtual : 12375 ret : -1
(00.304504) Error (/usr/src/debug/lib32-criu-webos/4.1+git/criu/cr-restore.c:1322): Can't fork for 12375: File exists
(00.308094) Error (/usr/src/debug/lib32-criu-webos/4.1+git/criu/cr-restore.c:2428): Restoring FAILED.