On Tuesday 21 October 2008 01:47:48 Ming-Ching Tiew wrote: > Rob Landley wrote: > > On Monday 20 October 2008 22:25:37 Ming-Ching Tiew wrote: > >> 5. In the bugged case, the daemonized process did not > >> actually die, it lingers around ( it's one of the 3 processes ). > >> Further down in the source, it calls ast_makesocket(). > >> But in ast_makesocket() it was stuck in pthread_create() > >> and never return ( this accounts for the additional 2 process > >> created ). > >> > >> Strange thing is that if I don't call daemon() or if I compile > >> daemon() into asterisk source, then ast_makesocket() > >> ( and hence pthread_create() ) will not block. > > > > Ok, so this is a case of calling pthread_create() after calling > > daemon(), except the simple test didn't cause a problem? > > I only found this out today. My simple test case I only tested > daemon(). So they did not cause a problem. I haven't > gotten to test calling daemon() and pthread_create() > in my test cases.
It turns out this isn't a new problem, by the way. Here's an irc conversation I was in a year ago that I'd forgotten: http://ibot.rikers.org/%23uclibc/20070928.html.gz Is there a bug tracker entry on this? It seems like the problem is doing a fork() without doing an exec, and then calling pthread_create() from the child process (which is not the thread group leader), and it never returns. Rob _______________________________________________ uClibc mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/uclibc
