NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/44950: fcntl(F_MAXFD) returns bogus values



On 5/10/11 9:20 AM, martin%NetBSD.org@localhost wrote:
Description:

The test case in /usr/tests/lib/libc/gen/t_closefrom fails when run when
invoked from a user with /bin/sh or /bin/ksh as shell, but works when invoked
from a (t)csch user.

How-To-Repeat:

        cd /tmp
        /usr/tests/lib/libc/gen/t_closefrom closefrom_basic

Ktrace shows that fcntl(F_MAXFD) returns 3 in the csh case, but 9 in the
(k)sh one.

I see several possibilities here:

* The test case is bogus because it's relying on the shell to leave a predeterminate amount of file descriptors open.

* ksh/sh are leaking file descriptors.

Note that a test misbehaving when run by hand (not through atf-run) should not be seen as a problem though.

Another thing is that atf-run should be closing the file descriptors in a consistent manner, but I can't see it doing so at the moment. (If we conclude that there is nothing else to do but adjust atf-run, assign the PR to me please.)

Home | Main Index | Thread Index | Old Index