all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob d8e0d9f740f0a127d5e4ea485095ec0e01b2ced8 2551 bytes (raw)
name: gnu/packages/patches/glibc-2-26-0077.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 
From bfdb34f2f26933a831684c09cadc2b782f7fbd7a Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Sat, 21 Oct 2017 11:33:27 -0200
Subject: [PATCH 77/90] posix: Do not use WNOHANG in waitpid call for Linux
 posix_spawn

As shown in some buildbot issues on aarch64 and powerpc, calling
clone (VFORK) and waitpid (WNOHANG) does not guarantee the child
is ready to be collected.  This patch changes the call back to 0
as before fe05e1cb6d64 fix.

This change can lead to the scenario 4.3 described in the commit,
where the waitpid call can hang undefinitely on the call.  However
this is also a very unlikely and also undefinied situation where
both the caller is trying to terminate a pid before posix_spawn
returns and the race pid reuse is triggered.  I don't see how to
correct handle this specific situation within posix_spawn.

Checked on x86_64-linux-gnu, aarch64-linux-gnu and
powerpc64-linux-gnu.

	* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Use 0 instead of
	WNOHANG in waitpid call.

(cherry picked from commit aa95a2414e4f664ca740ad5f4a72d9145abbd426)

diff --git a/ChangeLog b/ChangeLog
index 34709f792e..c3418c3277 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-11-07  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Use 0 instead of
+	WNOHANG in waitpid call.
+
 	[BZ #22273]
 	* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Handle the case where
 	the auxiliary process is terminated by a signal before calling _exit
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index 76001b6624..7d23df84d2 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -374,12 +374,12 @@ __spawnix (pid_t * pid, const char *file,
       ec = args.err;
       if (ec > 0)
 	/* There still an unlikely case where the child is cancelled after
-	   setting args.err, due to a positive error value.  Also due a
+	   setting args.err, due to a positive error value.  Also there is
 	   possible pid reuse race (where the kernel allocated the same pid
-	   to unrelated process) we need not to undefinitely hang expecting
-	   an invalid pid.  In both cases an error is returned to the
-	   caller.  */
-	__waitpid (new_pid, NULL, WNOHANG);
+	   to an unrelated process).  Unfortunately due synchronization
+	   issues where the kernel might not have the process collected
+	   the waitpid below can not use WNOHANG.  */
+	__waitpid (new_pid, NULL, 0);
     }
   else
     ec = -new_pid;

debug log:

solving d8e0d9f74 ...
found d8e0d9f74 in https://yhetil.org/guix/87ine0pjiu.fsf@fastmail.com/ ||
	https://yhetil.org/guix/87d148pe57.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix/87ine0pjiu.fsf@fastmail.com/
diff --git a/gnu/packages/patches/glibc-2-26-0077.patch b/gnu/packages/patches/glibc-2-26-0077.patch
new file mode 100644
index 000000000..d8e0d9f74

1:39: trailing whitespace.
 
1:43: space before tab in indent.
 	[BZ #22273]
1:44: space before tab in indent.
 	* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Handle the case where
1:45: space before tab in indent.
 	the auxiliary process is terminated by a signal before calling _exit
1:53: space before tab in indent.
 	/* There still an unlikely case where the child is cancelled after
Checking patch gnu/packages/patches/glibc-2-26-0077.patch...
Applied patch gnu/packages/patches/glibc-2-26-0077.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

skipping https://yhetil.org/guix/87d148pe57.fsf@fastmail.com/ for d8e0d9f74
index at:
100644 d8e0d9f740f0a127d5e4ea485095ec0e01b2ced8	gnu/packages/patches/glibc-2-26-0077.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.