Messages in this thread | | | Date | Tue, 17 Apr 2012 20:35:13 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH] pidns: reboot_pid_ns: use SEND_SIG_FORCED instead of force_sig() |
| |
On 04/16, Oleg Nesterov wrote: > > I'll investigate and report tomorrow.
Thanks again Serge, everything is clear. Afaics this needs another (almost off-topic) patch.
Please forget about sys_reboot() for the moment. There is a minor and known problem with SIGKILL && SIGNAL_UNKILLABLE. If you send SIGKILL from the parent namespace to cinit, this doesn't make it SIGNAL_GROUP_EXIT immediately. Only after cinit actually dequeues SIGKILL it does do_group_exit() and set this flag. This should be fixed anyway, but not now.
And this explain the problem. Note that your test-case does sys_reboot() from the init process, and reboot_pid_ns() does
kill(pid_ns->child_reaper, SIGKILL);
do_exit(0);
so it sends SIGKILL to itself and exit. This means that cinit (current) obviously can't dequeue SIGKILL, and without SIGNAL_GROUP_EXIT wait_task_zombie() ignores signal->group_exit_code.
That is why the patch makes a difference.
But why reboot_pid_ns() does do_exit? Yes, it was copied from sys_reboot() and I didn't notice. It should use do_group_exit(), and sys_reboot() too. This is the patch I am going to send, but I'll try to think a bit more.
Thanks!
Oleg.
| |