[CRIU] Re: [PATCH cr 0/9] Dump zombies from another PID namespace

Andrey Wagin avagin at gmail.com
Fri Sep 7 04:47:48 EDT 2012


2012/9/7 Pavel Emelyanov <xemul at parallels.com>:
> On 09/04/2012 05:10 PM, Andrey Vagin wrote:
>> The problem is to get a virtual pid for zombies.
>> This code gets two list of children from current and target pidns.
>
> It does so by getting a target's proc via parasite. Wouldn't it be
> easier to ask for the target to read the children himself and report
> back?
We can't use a crtools' /proc/self/, because we will see PID's from
crtools' pidns, even if we will read data from a parasite.

I execute screen in a new pidns.
[root at dhcp-10-30-20-19 ~]# echo $$
3
[root at dhcp-10-30-20-19 ~]# cat /proc/self/status | grep id
Tgid:   14286
Pid:    14286
PPid:   14273

And there is one more surprise:
# cat /proc/self/task/*/children
cat: /proc/self/task/14273/children: No such file or directory
# cat /proc/14273/task/*/children
14290

>
>> Then it removes alive task from the second list and dumps remaining zombies.
>>
>> A procfs from a target pidns is needed for dumping zombies,
>> crtools gets it from parasite code.
>>
>> Andrey Vagin (9):
>>   dump: get children by pid instead of pstree_item
>>   parasite: get a file descriptor for procfs from a target pidns
>>   util: add ability to change a file descriptor on procfs
>>   crtools: use pit_t for PIDs
>>   dump: use a virtual pid in names of zombie's core files
>>   dump: get a file descriptor on procfs from parasite
>>   dump: avoid extra jumps dump_one_task
>>   dump: dump zombies from another PID namespace
>>   restore: prevent killing of nonpositive PIDs
>>
>>  cr-dump.c                  |  162 +++++++++++++++++++++++++++++++++++---------
>>  cr-restore.c               |    3 +-
>>  include/crtools.h          |    4 +-
>>  include/parasite-syscall.h |    3 +-
>>  include/parasite.h         |    1 +
>>  include/syscall-x86-64.def |    4 +
>>  include/util.h             |    2 +
>>  parasite-syscall.c         |   21 ++++++-
>>  parasite.c                 |   42 +++++++++++
>>  test/zdtm.sh               |    4 +-
>>  util.c                     |   29 ++++++++
>>  11 files changed, 236 insertions(+), 39 deletions(-)
>


More information about the CRIU mailing list