https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740
--- Comment #3 from bert hubert <ahu at ds9a dot nl> --- Note that in https://stackoverflow.com/questions/12605725/basic-thread-locking-in-c11/12608911#12608911 we read the calling flush() from two threads at the same time is not legal if the streams are unsynchronised. The tie() may be causing this unexpectedly.