NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/38374: fdfile leak



The following reply was made to PR kern/38374; it has been noted by GNATS.

From: yamt%mwd.biglobe.ne.jp@localhost (YAMAMOTO Takashi)
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/38374: fdfile leak
Date: Mon,  7 Apr 2008 13:57:39 +0900 (JST)

 > Maybe fd_lastfile is not being updated correctly?
 
 fd_lastfile shrinks without freeing fdfile_t.
 
 YAMAMOTO Takashi
 
 Index: kern_descrip.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/kern_descrip.c,v
 retrieving revision 1.174
 diff -u -p -r1.174 kern_descrip.c
 --- kern_descrip.c     27 Mar 2008 18:33:39 -0000      1.174
 +++ kern_descrip.c     7 Apr 2008 04:56:22 -0000
 @@ -1475,7 +1475,7 @@ fd_free(void)
        /*
         * Close any files that the process holds open.
         */
 -      for (fd = 0, lastfd = fdp->fd_lastfile; fd <= lastfd; fd++) {
 +      for (fd = 0, lastfd = fdp->fd_nfiles - 1; fd <= lastfd; fd++) {
                ff = fdp->fd_ofiles[fd];
                KASSERT(fd >= NDFDFILE ||
                    ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
 


Home | Main Index | Thread Index | Old Index