This is the mail archive of the libc-alpha@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]

[PATCH] [BZ #15392] Remove fork child pid assertion


This assertion is no longer always true, since a forked child may be in
a different PID namespace than its parent, and the two namespace may
have PID collisions.

An example program which hits this assert is attached to bug 17596.

	[BZ #15392]
	* sysdeps/nptl/fork.c (__libc_fork): Remove assert that the parent
	and child pid must differ after forking.
---
 sysdeps/nptl/fork.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index a7dafa8..6adb723 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -139,8 +139,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;
-- 
2.1.0.rc2.206.gedb03e5


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