On Wed, Nov 7, 2012 at 2:03 AM,  <cmpil...@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

Reply via email to