inetd fd leak?
Doug Graham
dgraham at nortel.com
Thu Sep 3 22:15:34 UTC 2009
Cathey, Jim wrote:
>> Let's try to simplify it. Try some (or all) of these:
>>
>
> Wilco.
>
>
>> * Run inetd with the same config on your own x?86 desktop.
>>
>
> That would be hard. Not impossible, but hard. (Not using
> busybox at all there, is my development system and don't
> want to screw it up.) Might do that a bit later.
>
>
I can reproduce this in UML. My image is Fedora Core 5 with glibc-2.4-11
installed, and I built busybox 1.3.2 against glibc (not uClibc). The
leak appears
to be related to syslog. For example, descriptor 6 was leaked, and
strace shows
only these operations on that descriptor:
socket(PF_FILE, SOCK_DGRAM, 0) = 6
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
connect(6, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
send(6, "<27>Sep 3 17:49:45 inetd[1938]:"..., 75, MSG_NOSIGNAL) = 75
After another run of bury.sh, the same thing happens on descriptor 7
(without 6
being closed first). The message being logged is this one:
Sep 3 17:49:45 uml0 inetd[1938]: telnet/tcp: too many connections, pausing
This is so totally weird that I figured it had to have something to do with
vfork (just because vfork is so totally weird itself). Replacing the
vfork in
inetd.c with a fork instead does fix my leak.
--Doug.
More information about the busybox
mailing list