Hi,

I too am encountering the very same bug on a 1900+ entry /home directory. The bug is easily reproducible :

$ mkdir /tmp/dir
$ cd /tmp/dir
$ for ((i=0; i<2000; i++)); do mkdir $i; done
$ getfacl *
[...]
user::rwx
group::r-x
other::r-x

getfacl: Too many open files
getfacl: Too many open files
getfacl: Too many open files
[...]


The bug only occurs with a great number of directories, not files. Both Woody and Sid (glibc 2.3.2) are affected. It seems that this is not an acl bug but a glibc bug. For example, it also occurs with the getfattr from the attr package.


After a bit of investigation, I suspect the nftw(3) function (file io/ftw.c in the glibc sources).

Here is an excerpt of "ltrace -S -n4 getfattr *" :

<... nftw64 resumed> ) = 1
nftw64(0xbfffec85, 0x08049500, 0, 0, 0x40136e48 <unfinished ...>
SYS_access(0xbfffec85, 4, 0x40136e48, 0, 0xbfffb8c4) = 0
SYS_stat64(0x0804d178, 0xbfffb768, 0x40137aa0, 0x4013b4ec, 0x0804d178) = 0
SYS_open("1916", 100352, 00) = 1023
SYS_fstat64(1023, 0xbfffb53c, 0x40137aa0, 0x4013b4ec, 1023) = 0
SYS_fcntl64(1023, 2, 1, 0x0804d178, 1023) = 0
listxattr(0x0804d178, 0, 0, 0x4002a2f8, 0x400235d8 <unfinished ...>
SYS_listxattr(0x0804d178, 0, 0, 0x40136e48, 0x08458098) = 0
<... listxattr resumed> ) = 0
free(0x0804b368) = <void>


At each inner loop of nftw64, the result of SYS_open increments by one until the kernel returns -EMFILE (Too many open files). I suspect that the opendir() call in ftw.c is not followed by a corresponding closedir().

I have no time to look further and I hope that someone else will easily find what's going wrong exactly.

Regards,

Xavier


-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Reply via email to