Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 May 2006 16:28:12 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: linux emulation file descriptor leakage -current? 
Message-ID:  <20060515232812.F1715294B9@mail.bitblocks.com>
In-Reply-To: Your message of "Mon, 15 May 2006 21:46:38 %2B0200." <20060515214638.04ade411@Magellan.Leidinger.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > Ok, I'll file a PR.

I did file a PR via send-pr but I don't see any email back.
Looks like it disappeared into thin air -- will file again.
Turns out the problem is not limited to skype or thunderbird.
I discovered that linux-firefox ate over 8800 descriptors and
linux-opera died a suspicious death (on exit it fails to
write the state of open windows if it can't get a file
descriptor and on restart it loses all the open windows) and
I had to dig some more.

The following code from linux_stats.c looked dodgy to me so I
reverted /sys/{i386/linux,compat/{linux,linprocfs}} to about
one month old state and the problem disappears.  skype still
opens about 296 files but no more.

-static void
-translate_fd_major_minor(struct thread *td, int fd, struct stat *buf)
-{
-       struct file *fp;
-       int error;
-       int major, minor;
-
-       if ((error = fget(td, fd, &fp)) != 0)
-               return;
-       if (fp->f_vnode) {
-               if (fp->f_vnode->v_type == VCHR
-                   || fp->f_vnode->v_type == VBLK) {
-                       if (fp->f_vnode->v_un.vu_cdev) {
-                               if (linux_driver_get_major_minor(
-                                   fp->f_vnode->v_un.vu_cdev->si_name,
-                                   &major, &minor) == 0) {
-                                       buf->st_rdev = (major << 8 | minor);
-                               }
-                       }
-               }
-       }
-       fdrop(fp, td);
-}
-
-static void
-translate_path_major_minor(struct thread *td, char *path, struct stat *buf)
-{
-       struct file *fp;
-       int fd;
-       int temp;
-
-       temp = td->td_retval[0];
-       if (kern_open(td, path, UIO_SYSSPACE, O_RDONLY, 0) != 0)
-               return;
-       fd = td->td_retval[0];
-       td->td_retval[0] = temp;
-       translate_fd_major_minor(td, fd, buf);
-       fget(td, fd, &fp);
-       closef(fp, td);
-}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060515232812.F1715294B9>