From f794465ca8bd2a8d41ee3b6928db5fb1479dc96d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 15 Nov 2012 19:35:18 +0100 Subject: [PATCH] Disable use of vfork() vfork() is just too weird. For instance, in this build: http://hydra.nixos.org/build/3330487 the value fromHook.writeSide becomes corrupted in the parent, even though the child only reads from it. At -O0 the problem goes away. Probably the child is overriding some spilled temporary variable. If I get bored I may implement using posix_spawn() instead. --- configure.ac | 2 +- src/libstore/build.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0eb7d76325..5816d75e50 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,7 @@ AC_CHECK_HEADERS([sys/mount.h], [], [], # Check for vfork. -AC_FUNC_FORK() +#AC_FUNC_FORK() # Check for lutimes, optionally used for changing the mtime of diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 2fd071ebad..9e0db9ee7f 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -355,7 +355,7 @@ void Goal::trace(const format & f) /* Common initialisation performed in child processes. */ -void commonChildInit(Pipe & logPipe) +static void commonChildInit(Pipe & logPipe) { /* Put the child in a separate session (and thus a separate process group) so that it has no controlling terminal (meaning