[C/R]: mktree.c: cr_set_creator() question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oren:

I was trying to run the ptree test I had posted earlier with v14-rc3
and get a SIGSEGV in mktree (when restarting a simple process tree).

The SIGSEGV is due to 'creator' being NULL @ mktree.c:585.

I debugged it a bit and was not clear on the following 'task-ppid == 1'
check. It seems to check for orphaned processes using 'ppid == 1',
but 'ppid == 1' could be 1 if the 'task' was an actual child of the
container-init right ?

Also, 'phantom' does not seem to be set anywhere and so 'creator'
ends up being NULL.

Since in my case, 'task' refers to an actual child of container-init,
I reversed the order of the following two checks as a quick hack, and
it seems to fix the SIGSEGV. 

[v14-rc3] mktree.c: cr_set_creator() (lines 543-553)

        } else if (task->ppid == 1) {
                /* (non-session-leader) orphan: creator is dummy */
                cr_dbg("pid %d: orphan session %d\n", task->pid, task->sid);
                if (!session->phantom)
                        if (cr_placeholder_task(ctx, task) < 0)
                                return -1;
                creator = session->phantom;
        } else if (task->sid == parent->sid) {
                /* (non-session-leader) inherit: creator is parent */
                cr_dbg("pid %d: inherit sid %d\n", task->pid, task->sid);
                creator = parent;


Sukadev
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux