This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-638-gaa95a24


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  aa95a2414e4f664ca740ad5f4a72d9145abbd426 (commit)
      from  a2e0a7f12ba57a49d1380c7ba1ff4b1f51d67347 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=aa95a2414e4f664ca740ad5f4a72d9145abbd426

commit aa95a2414e4f664ca740ad5f4a72d9145abbd426
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Sat Oct 21 11:33:27 2017 -0200

    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.

diff --git a/ChangeLog b/ChangeLog
index b756f97..4448c3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-23  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Use 0 instead of
+	WNOHANG in waitpid call.
+
 2017-10-23  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
 	* manual/conf.texi (_SC_LEVEL1_DCACHE_LINESIZE,
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index d15fbb1..fb83c2e 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;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |    5 +++++
 sysdeps/unix/sysv/linux/spawni.c |   10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]