bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: popen/pthread/static-libs bug


From: Davy Durham
Subject: Re: popen/pthread/static-libs bug
Date: Fri, 05 Jul 2002 00:54:05 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/00200205

Now, for anyone who's watching I noticed after comparing an strace of the program below that the dynamically linked one does a fork() in the popen and the statically linked one does a vfork(). Perhaps the threading is doing something that shouldn't be done after a vfork(), but why one calls fork() and the other vfork() just because of the different linking I don't know.. but it still looks like a bug or some workaround that needs to be mentioned in the man pages (which I don't see)

-- Davy

David Durham wrote:


Actually.. this source code can even be reduced to (I don't know why I had the pthread_join in there.. it hangs at the pthread_create):

#include <stdio.h>
#include <pthread.h>

void *func(void *temp)
{
    return NULL;
}

int main()
{
    pthread_t threadID;

    popen("ls","r");

    pthread_create(&threadID,NULL,func,NULL);
return 0;
}











reply via email to

[Prev in Thread] Current Thread [Next in Thread]