New LinuxThreads bug, I think

Kaz Kylheku kaz@ashi.footprints.net
Wed Apr 26 22:15:00 GMT 2000


The Single UNIX Spec says that when all threads call pthread_exit()
the process terminates as if it called exit(0).
This means that atexit functions are called, and stdio buffers are flushed.

LinuxThreads does not do this.  For example, the unflushed stdout output of a
test program whose threads call pthread_exit() is simply discarded!

This only becomes apparent when you redirect the output of such a program
to a file, because stdout is then fully buffered rather than line buffered.

I'm working on a related part of the library and I just noticed that my
new test program creates a zero length .out file, but when run interactively,
produces the correct output!

The cause is that all threads simply call _exit(0).  

Anyway, I will fix this as part of the shutdown-related work I'm already doing
and make it into one patch.



More information about the Libc-alpha mailing list