diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index d0ecfeba..2be3dd80 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -1,6 +1,7 @@ #include #include +#define GC_LINUX_THREADS 1 #include #include "shared.hh" @@ -265,9 +266,14 @@ int main(int argc, char * * argv) ProcessOptions options; options.allowVfork = false; + GC_atfork_prepare(); + auto pid = startProcess([&]() { pipe.readSide = -1; + GC_atfork_child(); + GC_start_mark_threads(); + if (lastAttrPath != "") debug("resuming from '%s'", lastAttrPath); /* FIXME: The build hook in conjunction with import-from-derivation is causing "unexpected EOF" during eval */ @@ -300,6 +306,8 @@ int main(int argc, char * * argv) exit(0); }, options); + GC_atfork_parent(); + pipe.writeSide = -1; int status;