|
From: Robert W. <rj...@du...> - 2003-04-20 21:50:38
Attachments:
fd-leakage.diff
|
Hi all, The attached patch to the CVS head tracks open file descriptors and dumps them out at the end of the run. If you don't specify any command-line options, you get a summary indicating how many fds are still open. If you specify --fd-list=yes, you get a more verbose list showing the filename (if it exists) for each open file descriptor, along with a backtrace from the point where it was opened. If the fd was inherited from the parent process, no backtrace is produced. The patch knows about file descriptors created by the following system calls: open, dup, dup2, pipe, socket, socketpair and accept. It also knows about file descriptors passed between processes using usix-domain socket cmsg's. Please let me know if I've missed any important calls. The patch also adds VG_(lseek), VG_(readlink) and VG_(getdents) to vg_mylibc, which some other people might find useful too. Regards, Robert. -- Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: Nicholas N. <nj...@ca...> - 2003-04-21 22:09:16
|
On 20 Apr 2003, Robert Walsh wrote: > The attached patch to the CVS head tracks open file descriptors and > dumps them out at the end of the run. Just curious: have you tried this with many real programs, eg. Mozilla, OpenOffice, KDE or Gnome apps? Did you find in practice that leaked file descriptors is a common problem? The patch looks very clean, BTW, thanks for it. N |