Re: dietlibc (0.31), fork and pthreads
Ingo Struck <[email protected]>
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
Hi Tim, I investigated a bit further into the dietlibc libpthread impl. The problem could be reproduced w/ a vanilla dietlibc-0.32, of course after patching the makefile for the -fno-stack-protector bug in Ubuntu. However, if I comment out the call to __thread_manager_close(); in libpthread/pthread_atfork.c, line 66 Your testcase works like expected (return fds 3,4 before fork, in child, and in parent). I am not able to explain this properly, but I am sure that Olaf Dreesen can. Kind regards Ingo Struck On Monday 01 March 2010 13:08:26 Ingo Struck wrote: > Hi Tim, > > > I am compiling with a gcc 4.4.1-4ubuntu0, dietlibc 0.31-1.2ubuntu2, on an > > x86 machine running ubuntu 9.10. > > I can reproduce your problem (w/ proper headers and waitpid call fixed) > on > > ubuntu 8.04.4 LTS, 2.6.24-26-server > gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4) > diet version 0.31-1ubuntu3 > > Seems to be a problem in the dietlib libpthread impl. > > Maybe you should have a closer look at __thread_manager_close, > __manager_pipe in libpthread/pthread_internal.c > and fork() in libpthread/pthread_atfork.c -- it seems that there > is a call to __thread_manager_close within pid_t fork () in the child > branch after the __libc_fork() call. > > __thread_manager_close calls close() on both mgr_recv_fd and mgr_send_fd > so maybe something goes wrong there. > > Kind regards > > Ingo Struck