[lxc-devel] [PATCH 1/2] lxc-start: fix the container leak when daemonize
Serge Hallyn
serge.hallyn at ubuntu.com
Sun Jan 19 18:12:34 UTC 2014
Quoting Serge Hallyn (serge.hallyn at ubuntu.com):
> Quoting Qiang Huang (h.huangqiang at huawei.com):
> > When start container with daemon model, we'll have a new daemon
> > process in lxcapi_start, whose c->numthreads is 2, inherited
> > from his father. Even his father return to main(), the
> > lxc_container_put won't affect son's numthreads.
>
> The memlock is only between threads. But the child is fork()ed, so the
> lxc_container_put() of one won't affect the other task.
>
> Now maybe wait_on_daemonized_start() should be doing an
> lxc_container_put()?
Really I'm not sure why the lxc_container_get() is there in the
daemonize case. I *think* we should drop it, but again I'd like
more time to think about it (or someone else to reason it through)
before sending a patch.
I'm surprised given the amount of threaded testing done in the
past by our go contingency :) that this has sneaked past.
-serge
More information about the lxc-devel
mailing list