Sometimes we put some debug prints in our code this way
printf(\"successfully reached at debug-point 1\\n\"); some code is here printf(\"successfully reached
Uh, well. You're wrong. Precisely for this reason, stderr is not buffered by default.
EDIT: Also, as a general suggestion, try using debugger breakpoints instead of printfs. Makes life much easier.
printf