robryk / parunner

Single-machine runner for multimachine Potyczki Algorytmiczne problems
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Stdouts of instances is buffered #5

Open robryk opened 9 years ago

robryk commented 9 years ago

Instances' stdout is not a terminal, so C stdio library uses a fixed size buffer as opposed to single-line buffer. This causes some output to be lost when an instance segfault or terminates unexpectedly in some other fashion.

It seems that the simplest way to fix this is changing stdout's buffering in zeus_local's initialization (with setvbuf).

robryk commented 9 years ago

A workaround is to use stderr instead of stdout: stderr is always either unbuffered or line buffered, unless that is manually changed with setvbuf.