hydra-eval-jobs: Reinitialize Boehm GC in the child

This is necessary to prevent hangs in the garbage collector.
This commit is contained in:
Eelco Dolstra 2018-08-10 20:25:43 +02:00
parent 7876cf677c
commit b542b73ced

View file

@ -1,6 +1,7 @@
#include <map>
#include <iostream>
#define GC_LINUX_THREADS 1
#include <gc/gc_allocator.h>
#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;