On Sun, Apr 18, 2010 at 5:19 PM, Andreas Metzler <ametz...@downhill.at.eu.org> wrote: > and the process just hangs and only reacts to kill -9. I have found > this when investigating why sv-bug-24169.exp in findutils testsuite > does not work on kfreebsd-*.
A quick look reveals that expect hangs on waitpid() call in Exp_WaitObjCmd() function defined in exp_commands.c (A few lines from exp_commands.c): ---------------------------------------------------------------------- while (1) { if (Tcl_AsyncReady()) { int rc = Tcl_AsyncInvoke(interp,TCL_OK); if (rc != TCL_OK) return(rc); } result = waitpid(esPtr->pid,(int *)&esPtr->wait,0); if (result == esPtr->pid) break; if (result == -1) { if (errno == EINTR) continue; else break; } } ---------------------------------------------------------------------- It seems like FreeBSD kernel doesn't terminate the spawned child if it did print something to stdout and nobody has read the printed chars. Though I'm not sure if this behavior is wrong. It's just different. So, may be the correct way is to fix expect script? The following script works fine on Linux and FreeBSD: spawn echo blubb expect { eof {puts [wait]} } BTW, I've reported this bug upstream. See https://sourceforge.net/tracker/?func=detail&aid=2989008&group_id=13179&atid=113179 Cheers! -- Sergei Golovan -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org