I knew I was asking for trouble by forking and not execing, and even more trouble by messing around with the file descriptors for stdin/out/err in the child process. I crossed the i's and dotted the t's and sacrificed the goats, and that seems to have prevented everything that I knew could go wrong, but this ... this is new and different and I have no fraggin' clue how to fix it: data written to stdout is showing up in a different stdio-opened file, one that has never had anything to do with stdin or out or err. But only part of it, and only intermittently, and (of course) never under strace.