[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: possible file/dir handle leaks

From: mark benedetto king <mbk_at_lowlatency.com>
Date: 2003-12-16 21:35:24 CET

On Tue, Dec 16, 2003 at 07:39:43PM +0100, SteveKing wrote:
> While trying to find out why there's a leaked file handle
> (see http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=52249
> for the complete thread about this.) and where it could be leaked I
> stumpled across some code parts which deserve some reviewing (I think).
>
 [...]
>
> libsvn_subr/io.c
> static int test_tempdir(const char *temp_dir, apr_pool_t *p)
> {
 [...]
> svn_error_t *
> svn_io_open_unique_file (apr_file_t **f,
> const char **unique_name_p,
> const char *path,
> const char *suffix,
> svn_boolean_t delete_on_close,
> apr_pool_t *pool)

These functions both create temporary files in a pool. This means
that when the pool is cleared, the handles are closed. So these
functions do not technically leak handles, in and of themselves.

However, it is possible that in some cases the pool lifetimes are
longer than they should be:

It looks like SVNStatus::GetStatus() and SVNStatus::GetFirstFileStatus()
do not immediately clear their pools, rather they use a pool with the
lifetime of the SVNStatus object (it is a member variable). Could
it be that the SVNStatus object is not getting deleted immediately?

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 16 21:35:54 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.