Bug with popen/pthread_create
Ulrich Drepper
drepper@redhat.com
Thu Feb 6 19:11:00 GMT 2003
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 `---------------------------
More information about the Libc-alpha
mailing list