On 21/04/2016 19:08, Joe Pfeiffer wrote:
I am investigating a bug in a third-party program.
That program has several FILE buffers open, writing logs
to different files, and it fork/execs a lot to run many
diagnostic sub-programs.
(At least) one of the logs is "corrupted" in that
1) it contains many duplicated lines
2) some expected lines are missing
Looking more closely at the fork/exec part, I can confirm that
the child calls exit(errno); when the exec() fails.
So it would seem that problems would occur only when exec fails?
If exec succeeds, we wouldn't flush the FILE buffer twice...
Hmmm, I am somewhat stumped.
Regards.