This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Bug with popen/pthread_create
Neal H. Walfield wrote:
>>This does not matter. This is no real world program, this is a short
>>example which triggers the bug. That's everything.
>
>
> No, fix your buggy program: pthread_wait for threads who have not
> finished before returning from main or calling exit. That's
> everything.
While I'm the last person to defend bad code I have to add that this is
wrong. Returning from main is an implicit call to exit() which has to
terminate the "process", i.e., all threads. It's not required to
perform a shutdown sequence with pthread_joins. It's the same as if
you'd require to free all memory you malloc. It just means wasted CPU
cycles.
The problem at hand stems from the re-introduction of a real vfork. We
thought it'd be alright now (and nptl has no problems) but for
LinuxThreads we still have to use fork (in popen and other places).
Patch is forthcoming.
--
--------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------