lix/src
Eelco Dolstra 524f89f139 Use unshare() instead of clone()
It turns out that using clone() to start a child process is unsafe in
a multithreaded program. It can cause the initialisation of a build
child process to hang in setgroups(), as seen several times in the
build farm:

The reason is that Glibc thinks that the other threads of the parent
exist in the child, so in setxid_mark_thread() it tries to get a futex
that has been acquired by another thread just before the clone(). With
fork(), Glibc runs pthread_atfork() handlers that take care of this
(in particular, __reclaim_stacks()). But clone() doesn't do that.

Fortunately, we can use fork()+unshare() instead of clone() to set up
private namespaces.

See also https://www.mail-archive.com/lxc-devel@lists.linuxcontainers.org/msg03434.html.
2014-08-21 14:08:09 +02:00
..
boost boost::shared_ptr -> std::shared_ptr 2014-03-30 00:49:23 +01:00
bsdiff-4.3 Fix "make dist" 2014-02-01 14:38:12 +01:00
download-via-ssh Use proper quotes everywhere 2014-08-20 18:03:48 +02:00
libexpr Fix a segfault in ‘nix-env -qa’ 2014-08-21 00:05:17 +02:00
libmain Flush std::cout before closing stdout 2014-08-20 21:44:55 +02:00
libstore Use unshare() instead of clone() 2014-08-21 14:08:09 +02:00
libutil Use proper quotes everywhere 2014-08-20 18:03:48 +02:00
nix-daemon Use proper quotes everywhere 2014-08-20 18:03:48 +02:00
nix-env Use pager for more commands 2014-08-20 21:44:55 +02:00
nix-hash Use proper quotes everywhere 2014-08-20 18:03:48 +02:00
nix-instantiate Use proper quotes everywhere 2014-08-20 18:03:48 +02:00
nix-log2xml nix-log2xml: Handle newlines 2014-08-13 19:06:20 +02:00
nix-store Use pager for more commands 2014-08-20 21:44:55 +02:00