File fork-remove-assertion.patch of Package glibc.18277

2017-05-12  Florian Weimer  <fweimer@redhat.com>

	[BZ #21386]
	* sysdeps/nptl/fork.c (__libc_fork): Remove assertions on the
	parent PID.  The assertion in the child is incorrect with PID
	namespaces.

Index: glibc-2.22/sysdeps/nptl/fork.c
===================================================================
--- glibc-2.22.orig/sysdeps/nptl/fork.c
+++ glibc-2.22/sysdeps/nptl/fork.c
@@ -116,10 +116,6 @@ __libc_fork (void)
      malloc dependency as well (via the getdelim function).  */
   __malloc_fork_lock_parent ();
 
-#ifndef NDEBUG
-  pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid);
-#endif
-
   /* We need to prevent the getpid() code to update the PID field so
      that, if a signal arrives in the child very early and the signal
      handler uses getpid(), the value returned is correct.  */
@@ -138,8 +134,6 @@ __libc_fork (void)
     {
       struct pthread *self = THREAD_SELF;
 
-      assert (THREAD_GETMEM (self, tid) != ppid);
-
       /* See __pthread_once.  */
       if (__fork_generation_pointer != NULL)
 	*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
@@ -213,8 +207,6 @@ __libc_fork (void)
     }
   else
     {
-      assert (THREAD_GETMEM (THREAD_SELF, tid) == ppid);
-
       /* Restore the PID value.  */
       THREAD_SETMEM (THREAD_SELF, pid, parentpid);
 
openSUSE Build Service is sponsored by