From cc418866a1dc7aa2ed8a67c711c2ea609bf06752 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Sun, 9 Dec 2007 02:07:09 +0000 Subject: Merge of Guillaume Chazarain's 24170: block interrupts around fork since it may mess with locks. --- Src/exec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Src/exec.c b/Src/exec.c index 19d68060f..76bd8638a 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -228,7 +228,15 @@ zfork(struct timeval *tv) } if (tv) gettimeofday(tv, &dummy_tz); + /* + * Queueing signals is necessary on Linux because fork() + * manipulates mutexes, leading to deadlock in memory + * allocation. We don't expect fork() to be particularly + * zippy anyway. + */ + queue_signals(); pid = fork(); + unqueue_signals(); if (pid == -1) { zerr("fork failed: %e", NULL, errno); return -1; -- cgit 1.4.1