Bug 18345 - rhnds leaking file descriptors
Summary: rhnds leaking file descriptors
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: up2date
Version: 7.0
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-04 17:23 UTC by Daryll
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2000-10-04 22:14:04 UTC


Attachments (Terms of Use)

Description Daryll 2000-10-04 17:23:19 UTC
I've had my machine up running 7.0 for a week now. Today I had a bunch
of problems with applications running and figured out my system was
running out of	file descriptors. When I did ls /proc/[1-9]*/fd, I saw
that the rhnds was using a lot of file descriptors. I just restarted the
daemon an hour ago and there are now 8	file descriptors open. The first
is a socket, the rest are pipes.

Comment 1 Daniel Roesen 2000-10-04 21:31:30 UTC
Verified.

Comment 2 Daniel Roesen 2000-10-04 21:56:50 UTC
rhnsd is loosing 2 FDs every --interval when trying to execute rhn_check

Comment 3 Daniel Roesen 2000-10-04 22:14:01 UTC
Problem in rhns_do_action():

static int rhns_do_action(void)
{
    [...]
    if (pipe(fds) != 0) {
        syslog(LOG_ERR, "Could not create pipe for forking process; %m");
        return -1;
    }
    
    if ((child = fork()) == 0) {
	[...]
    } else if (child > 0) {
	[...]
                    syslog(LOG_INFO, "command returned: %s", buf);
                    free(buf);
                    if (WIFEXITED(retval))
                        return WEXITSTATUS(retval);


So it forgets to close the two pipe FDs if the child process (rhn_check) returns
an error (like it does by default as it's unconfigured).


Comment 4 Preston Brown 2000-10-09 15:08:05 UTC
this is corrected in an errata, to be released shortly.


Note You need to log in before you can comment on or make changes to this bug.