Bug with popen/pthread_create

Thorsten Kukuk kukuk@suse.de
Thu Feb 6 14:42:00 GMT 2003


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



More information about the Libc-alpha mailing list