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

Bug with popen/pthread_create


Hi,

the appendend testprogram works fine with glibc 2.2.x, but it does
not work with current glibc from CVS. The "printf("in main\n");
is never reached. If I don't call popen(), it works fine. Any ideas,
what could go wrong? This happens on all architectures.


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

void *foo(){
   printf("in foo\n");
   return NULL;
}

int main() {
   int rc;
   pthread_t threadID;
   FILE *fd;

   fd = popen("/bin/ls", "r");
   pclose(fd);

   rc = pthread_create(&threadID, NULL, &foo, NULL);
   printf("in main\n");
   return rc;
}

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Deutschherrnstr. 15-19        D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B


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