Re: file descriptor leak in 5.2-RC

From: David Malone <dwmalone_at_maths.tcd.ie>
Date: Sat, 27 Dec 2003 12:53:20 +0000
> I had a quick look over the rest of the table, and it seems as if nearly 
> every other line looks the same as the fast few lines, except the LOC 
> value changing. kern.openfiles show 4332, so the pstat -f output 
> corresponds with these values just fine.

> Does that mean, that with the same value for "DATA" it is the same file 
> all over that's opened? Can I somehow find the correspondig file?

Hmmm - could be... The following patch to fstat prints the data
field for inodes in fstat's output. I'd suggest:

	1) Run until you have alot of the same inode stuck open.
	2) Run pstat -f and get the data value.
	3) Run fstat and grep for the data value in question.

You might need to do 3 a few times, depending on how long the phantom
inode is actually open for while the program is running. I wonder
if it is some sort of device cloning/refcounting problem?

	David.


Index: fstat.c
===================================================================
RCS file: /cvs/FreeBSD-CVS/src/usr.bin/fstat/fstat.c,v
retrieving revision 1.51
diff -u -r1.51 fstat.c
--- fstat.c	24 Jun 2003 08:18:18 -0000	1.51
+++ fstat.c	27 Dec 2003 12:47:33 -0000
_at__at_ -533,6 +526,9 _at__at_
 			return;
 	}
 	PREFIX(i);
+	/* DMXXX */
+	printf(" %p ", vp);
+	/* DMXXX */
 	if (badtype) {
 		(void)printf(" -         -  %10s    -\n", badtype);
 		return;
Received on Sat Dec 27 2003 - 03:53:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:35 UTC