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

move-tracking-2 pool management

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 09 Jul 2015 17:45:25 +0100

Build the branch with pool debugging on APR and tests fail on the merge
operation with:

  apr_hash_merge: overlay's pool is not an ancestor of p
  Aborted

The problem is the pattern used to create svnmover_wc_t objects: a
result pool is passed to wc_create(), a subpool is created and the
object and its data are alocated in that subpool. Later when execute()
calls svn_branch_merge() it passes data allocated in that subpool but
the scratch_pool that also gets passed is a sibling not a descendant of
that pool.

A simple fix is

Index: ../src2/subversion/svnmover/svnmover.c
===================================================================
--- ../src2/subversion/svnmover/svnmover.c (revision 1690117)
+++ ../src2/subversion/svnmover/svnmover.c (working copy)
@@ -2523,7 +2523,7 @@
 {
   svn_editor3_t *editor;
   const char *base_relpath;
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(wc->pool);
   int i;
 
   editor = wc->editor;

I think allocating the subpool in wc_create() is a bit of an
anti-pattern, it takes pool management away from the caller. Simply
eliminating the subpool is not a fix unless final_commit() is also
changed to not destroy the svnmover_wc_t pool.

-- 
Philip Martin
WANdisco
Received on 2015-07-09 18:45:36 CEST

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.