In some situations stdio reads on processes block forever even after the process exited. I'm now using another thread that 'joins' the process and then unblocks the readers.