Bug 22794 - gdm leaks file descriptors
gdm leaks file descriptors
Status: CLOSED DUPLICATE of bug 12301
Product: Red Hat Linux
Classification: Retired
Component: gdm (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Havoc Pennington
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-12-23 18:29 EST by horms
Modified: 2007-04-18 12:30 EDT (History)
2 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description horms 2000-12-23 18:29:37 EST
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 14:48:18 EST
Fixed in 7.0

*** This bug has been marked as a duplicate of 12301 ***
Comment 2 Michael Jennings (KainX) 2001-01-02 18:41:54 EST
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-02 19:01:08 EST
Ah, thanks. I went ahead and changed the patch to have the second close().
Comment 4 Michael Jennings (KainX) 2001-01-02 19:09:08 EST
Any idea when we can expect a new SRPM, or what it will be called?  Thanks....
Comment 5 Havoc Pennington 2001-01-02 19:25:12 EST
It'll be in the next beta

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