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

Re: svn commit: r1406366 - /subversion/trunk/subversion/libsvn_ra_serf/update.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Mon, 12 Nov 2012 15:04:48 +0400

On Wed, Nov 7, 2012 at 2:03 AM, <cmpilato_at_apache.org> wrote:
> Author: cmpilato
> Date: Tue Nov 6 22:03:04 2012
> New Revision: 1406366
>
> URL: http://svn.apache.org/viewvc?rev=1406366&view=rev
> Log:
> Teach ra_serf to more carefully track the PROPFIND requests it issues
> for directories, especially the completion thereof, and to
> opportunistically close directory batons that no longer need to be
> opened. Prior to this change, directories in which no files had their
> contents fetched from the server were held open until the end of the
> editor drive, which caused a nasty accumulation of allocated tracking
> structures.
>
> I'll be so bold as to claim that this fixed issue #4194 ("serf memory
> leak on checkout").
>
> * subversion/libsvn_ra_serf/update.c
> (report_dir_t): Add 'done_dir_propfinds' and 'active_dir_propfinds' lists.
> (report_context_t): Add 'closed_root' flag.
> (maybe_close_dir_chain): New helper function, abstracted from logic
> in finish_report(), which encapsulates the "see if we can close a
> directory and its parents opportunistically" logic.
> (handle_propchange_only, handle_local_content): Now call
> maybe_close_dir_chain(), too.
> (end_report): Track completed directory PROPFINDs in the new
> 'done_dir_propfinds' list, now, and also populate the new
> 'active_dir_propfinds' list.
> (finish_report): Now also monitor the completed directory PROPFINDs,
> using maybe_close_dir_chain() to close directories sooner rather
> than later.
>
[...]

> /* Open the file associated with INFO for editing, pass along any
> propchanges we've recorded for it, and then close the file. */
> static svn_error_t *
> @@ -1189,6 +1234,7 @@ handle_propchange_only(report_info_t *in
> svn_pool_destroy(info->pool);
>
> info->dir->ref_count--;
> + SVN_ERR(maybe_close_dir_chain(info->dir));
>
> return SVN_NO_ERROR;
> }
> @@ -1213,6 +1259,7 @@ handle_local_content(report_info_t *info
> svn_pool_destroy(info->pool);
>
> info->dir->ref_count--;
> + SVN_ERR(maybe_close_dir_chain(info->dir));
>
Mike,

This change seems to cause problem with access to freed memory: list
item also allocated in dir pool and finish_report() accesses it after
calling to handle_local_content().

-- 
Ivan Zhakov
Received on 2012-11-12 12:05:44 CET

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.