# Synchronisation of stdin, stderr

#### skaller

11 Oct, 2015 01:54 PM

My log shows massive delays in output. For example:

Processing [82/84]: tut_16.flx
Processing [83/84]: tut_17.flx
Processing [84/84]: tut_18.flx
Batch result (83 OK + 01 FAIL)/84
[flx] Output C:\Users\appveyor\.felix\cache\text\C\projects\felix\build\release\test\tut\arithmetic.stdout doesn't match expected C:\projects\felix\build\release\test\tut\arithmetic.expect

The message here refers to test #1 but only enters the log after all 84 the tests are complete.
This doesn't happen on my personal windows box. I'm using C FILE* for output. Most of the writes to stdout
are followed by a fflush. Stderr is supposed to be unbuffered. Therefore the output should be synchronised.

1. Support Staff Posted by Feodor Fitsner on 12 Oct, 2015 08:33 PM

AppVeyor uses the same pipe for collecting StdOut and StdErr, so I guess you see the output in the same order it comes to that pipe.

2. Posted by skaller on 12 Oct, 2015 09:29 PM

I see. However that ordering is not the same as I see in a CMD
console on Win10.

Usually, one assumes stderr is unbuffered, and stdout is buffered.
These are C level attributes, the OS may also have buffering
on top of that.

I have switched my program so “write a line to stdout” writes
and then does a fflush. So I guess what I am seeing
is the stderr is coming out long after stdout. Usually its the
other way around.

In other words the C stderr is in fact buffered.

Interesting. In C++, cout and cerr are *required* by default
to be tied (i.e. they have to go to the same ostream).

Ok, so I will have to fflush stderr as well.
Thanks!

3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:00 AM.

Comments are currently closed for this discussion. You can start a new one.

# Keyboard shortcuts

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 13 Aug, 2020 03:56 AM Error installing AppVeyor agent on Windows 2008 R2 11 Aug, 2020 04:56 PM nsis.install (exited 404) 11 Aug, 2020 11:52 AM BUILD 10 Aug, 2020 09:23 PM How to revert back to the previous good setting of Appveyor project 10 Aug, 2020 07:42 PM C#6 string interpolation support
 10 Aug, 2020 07:16 PM snupkg symbols are not uploaded to nuget.org 07 Aug, 2020 05:50 PM Only main branch builds 07 Aug, 2020 05:48 PM Maximum allowed artifact storage size 07 Aug, 2020 05:47 PM There was an error while trying to complete the current operation. Please contact AppVeyor support. 04 Aug, 2020 04:28 PM Ubuntu SQL Server ODBC driver 04 Aug, 2020 10:28 AM macos image: PowerShell: Install-Module does not work