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



The following reply was made to PR kern/44950; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, 
martin%NetBSD.org@localhost
Cc: 
Subject: Re: kern/44950: fcntl(F_MAXFD) returns bogus values
Date: Wed, 11 May 2011 08:53:33 -0400

 On May 11,  7:45am, martin%duskware.de@localhost (Martin Husemann) wrote:
 -- Subject: Re: kern/44950: fcntl(F_MAXFD) returns bogus values
 
 | The following reply was made to PR kern/44950; it has been noted by GNATS.
 | 
 | From: Martin Husemann <martin%duskware.de@localhost>
 | To: Jukka Ruohonen <jruohonen%iki.fi@localhost>
 | Cc: gnats-bugs%NetBSD.org@localhost, Julio Merino 
<jmmv%julipedia.org@localhost>
 | Subject: Re: kern/44950: fcntl(F_MAXFD) returns bogus values
 | Date: Wed, 11 May 2011 09:43:52 +0200
 | 
 |  The test case should probably:
 |  
 |   - gain a comment that it relies on fd 0 .. 2 to be valid
 |   - do a closefrom(3) early
 |   - assert that fd is > 2
 |  
 |  Besides that, this is more of a (k)sh bug, which seems to be pretty common
 |  for bourne shells in general (or so says the internet, the fd in use seems
 |  to vary, typically 19 instead of 9). The shell keeps an fd open when it 
execs
 |  scripts from a file.
 |  
 |  What now? Split this PR into two, one for the testcase, one for (k)sh?
 |  Or fix the testcase and reuse this as the PR for the shell?
 
 Fix the test so that it runs a loop to close file descriptors from 0 to the
 descriptor soft limit and then open and arrange them as it wishes. Note that
 you cannot depend on what file descriptors the shell may have open. Just to
 give an example, if you do an NIS operation you end up with a file descriptor
 open.
 
 christos
 


Home | Main Index | Thread Index | Old Index