On Wed, Oct 24, 2012 at 2:18 PM, Andreas Schwab <sch...@linux-m68k.org> wrote: > Uros Bizjak <ubiz...@gmail.com> writes: > >> To answer my own question: >> >> dup(4) = 9 >> ... >> close(9) = 0 >> dup(4) = -1 EBADF (Bad file descriptor) >> >> Test is calling dup on a closed file descriptor. > > FD 4 is most likely closed by one of the cloned threads. Use strace -f > to follow them.
Yes, indeed! Attached strace -f record confirms this on alpha. The same happens on x86_64, but for some reason x86_64 doesn't complain when executing dup(2) on closed FD. Uros.