Bug 22794 - gdm leaks file descriptors
Summary: gdm leaks file descriptors
Status: CLOSED DUPLICATE of bug 12301
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdm (Show other bugs)
(Show other bugs)
Version: 6.2
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-12-23 23:29 UTC by horms
Modified: 2007-04-18 16:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-02 15:59:22 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description horms 2000-12-23 23:29:37 UTC
Gdm opens a file descripor for logging and then uses dup2(2). However,
the origianl file descriptor opened is not closed. The leak occurs
when a user logs out of X and will continue untill gdm is restarted,
usually when the system is rebooted. I believe this effects all versions of gdm to date. The following patch 
fixes this problem:

diff -ruN gdm-2.0beta2.orig/daemon/server.c gdm-2.0beta2.new/daemon/server.c
--- gdm-2.0beta2.orig/daemon/server.c   Sat Dec 23 17:02:11 2000
+++ gdm-2.0beta2.new/daemon/server.c    Sat Dec 23 17:54:51 2000
@@ -96,6 +96,7 @@
     if (logfd != -1) {
        dup2 (logfd, 1);
        dup2 (logfd, 2);
+       close (logfd);
     }
     else
        gdm_error (_("gdm_server_start: Could not open logfile for display %s!"), d->name);
diff -ruN gdm-2.0beta2.orig/daemon/xdmcp.c gdm-2.0beta2.new/daemon/xdmcp.c
--- gdm-2.0beta2.orig/daemon/xdmcp.c    Sat Dec 23 17:02:11 2000
+++ gdm-2.0beta2.new/daemon/xdmcp.c     Sat Dec 23 17:54:36 2000
@@ -750,6 +750,7 @@
        if (logfd != -1) {
            dup2 (logfd, 1);
            dup2 (logfd, 2);
+           close (logfd);
        }
        else
            gdm_error (_("gdm_xdmcp_handle_manage: Could not open logfile for display %s!"), d->name);

Comment 1 Havoc Pennington 2001-01-02 19:48:18 UTC
Fixed in 7.0

*** This bug has been marked as a duplicate of 12301 ***

Comment 2 Michael Jennings (KainX) 2001-01-02 23:41:54 UTC
After comparing your gdm-2.0beta2-fdleak.patch from 7.0 and horms' patch above,
you will find that you fixed one leak but not the other.  The patch above also
affects daemon/server.c, which yours does not.

This bug should be reopened until the issue is fixed completely.


Comment 3 Havoc Pennington 2001-01-03 00:01:08 UTC
Ah, thanks. I went ahead and changed the patch to have the second close().


Comment 4 Michael Jennings (KainX) 2001-01-03 00:09:08 UTC
Any idea when we can expect a new SRPM, or what it will be called?  Thanks....


Comment 5 Havoc Pennington 2001-01-03 00:25:12 UTC
It'll be in the next beta


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