|
From: Robert W. <rj...@du...> - 2003-03-30 04:24:29
Attachments:
fd-lossage.diff
|
Hi all,
The attached patch keeps track of all open file descriptors and dumps
out a summary at the end of the run if --leak-check is used. It knows
about fds that have been inherited from the parent process. The
information it dumps out is the fd and a backtrace from where it was
opened.
Some caveats/questions:
* Right now, it doesn't handle fds that have been passed over a
socket using sendmsg. This shouldn't be too difficult to add -
I'll try get it done in the next couple of days.
* If /proc is missing (which is unlikely, but you never know) then
it doesn't notice fds that have been inherited from the parent
process. This would be easyish to fix, too.
* It should dump out more information about each open fd - the
filename or socket information would be useful, for example.
Again, I'll add that in in the next couple of days.
* Should it use it's own command-line option instead of
piggy-backing on top of --leak-check?
The patch is against the CVS head as of 8PM PST on March 29th. I'm
releasing it now despite all of the above missing functionality because
it's still useful. Please let me know what you think.
Regards,
Robert.
--
Robert Walsh
Amalgamated Durables, Inc. - "We don't make the things you buy."
Email: rj...@du...
|