Leaking file descriptors in mock builds?

Orion Poplawski orion at cora.nwra.com
Fri Apr 20 18:34:46 UTC 2007


The latest version of hdf 4 has a test for opening the maximum available 
files.  This fails when run under mock and the build system because the 
test (stupidly?) assumes that there will only be 3 file descriptors 
currently open by the test process when run.

However, when run under mock there are other file descriptors open:

make    31221 orion    0r   CHR    1,3              1519 /dev/null
make    31221 orion    1w  FIFO    0,6            187314 pipe
make    31221 orion    2w  FIFO    0,6            187314 pipe
make    31221 orion    3u   REG  253,2    9000 125829249 
/var/lib/mock/fedora-6-i386-core/result/root.log
make    31221 orion    4u   REG  253,2  171985 125829254 
/var/lib/mock/fedora-6-i386-core/result/build.log
make    31221 orion    5r  FIFO    0,6            192903 pipe

And apparently even more open when run on the buildsystem.

So, my first question is, is this correct or is mock leaking file 
descriptors?

Second is how to fix the test.  My first inclination is just to allow 
for the possibility of 10 open file descriptors when the test is run.  A 
hack, but it seems kind of a silly test anyways.  Is there a system call 
to return how many file descriptors are already in use?

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion at cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com




More information about the fedora-devel-list mailing list