[lxc-devel] Potential deadlock with lxcfs and lxc-freeze

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Feb 12 12:53:46 UTC 2016


> Fabian Grünbichler <f.gruenbichler at proxmox.com> hat am 12. Februar 2016 um
> 08:42 geschrieben:
> 
> I'll try to reproduce the issue with something other than (/proc/)uptime.

It seems that the other causes reported by our users can all be traced back to
/proc/uptime - running "ps" in the container instead of uptime will also exhibit
the exact same behaviour. Upon closer examination, this is not surprising
because ps initializes a global variable in global.c:reset_global using
uptime(), and reset_global is called in ps' main().

Summary so far: uptime, ps and any other process accessing /proc/uptime within a
container using lxcfs can pretty reliably make the whole container unfreezable
and cause the uptime-accessing process itself and the associated lxcfs process
to wait forever. Both states persist until either the container is shutdown or
the waiting lxcfs process is forcibly killed. The latter will also allow an
ongoing, hanging freeze to finish.

If you are trying to reproduce this issue, it seems to trigger faster with more
processes accessing /proc/uptime in parallel, but it is possible to trigger it
with only one uptime/ps call in a while loop and an unmodified lxc-freeze sleep
time, if you are patient enough. It seems to take between a couple thousand and
a couple ten thousand freeze attempts with this simple setup, so be prepared to
leave it running for a couple of hours.

Regards,
Fabian



More information about the lxc-devel mailing list