N/m. It seems that when I migrated from popen() to pipe()/fork()/execv() I neglected to comment out the original popen(). I had to have an epiphany that these problems might be caused by the shell program being called twice, before I'd realize this.