[Bug nptl/14697] Behavior of exit is nonconformant with respect to threads and stdio

bugdal at aerifal dot cx sourceware-bugzilla@sourceware.org
Mon Oct 6 17:51:00 GMT 2014


https://sourceware.org/bugzilla/show_bug.cgi?id=14697

--- Comment #1 from Rich Felker <bugdal at aerifal dot cx> ---
It seems that this bug can also result in more serious corruption such as
duplicate output, even without any explicit file locking. See the example in
this question on Stack Overflow, which is a perfectly valid program producing
incorrect output:

http://stackoverflow.com/questions/26211423/unexpected-output-in-a-multithreaded-program

Of course the program has unpredictable output, but there is a finite set of
outputs it can produce on a correct implementation: different interleavings of
the lines, and different cutoffs for the number of lines produced by
sample_thread. A real-world example where this could easily happen is writing a
log file using stdio.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list