This is the mail archive of the libc-alpha@sourceware.cygnus.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]

New LinuxThreads bug, I think


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.


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