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

svn_client_commit3() endless loop with memory leak

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2006-07-31 18:37:46 CEST


With the very latest build of the libraries from the 1.4.x branch I
discovered an endless loop in svn_client_commit3(). To reproduce:

call svn_client_commit3() with two paths in the path list:

Now, in libsvn_client/commit.c, line 1211:
   /* Condense the target list. */
   SVN_ERR(svn_path_condense_targets(&base_dir, &rel_targets, targets,
                                     recurse, pool));
base_dir gets the value "D:/tttt". Further down in line 1295ff:
           /* Now we need to iterate over the parent paths of this path
              adding them to the set of directories we want to lock. */
           svn_path_split(target, &parent_dir, &name, subpool);

           target = parent_dir;

           while (strcmp(target, base_dir))
               if (target[0] == '/' && target[1] == '\0')

                              const char *) = apr_pstrdup(pool, target);
               target = svn_path_dirname(target, subpool);

is where the endless loop happens. The 'parent_dir' variable gets
initialized to "D:" in svn_path_split(...). Then, in the while loop,
targets becomes an empty string and the loop never finishes. But it
constantly allocates memory until the system runs out of memory.


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 31 18:38:34 2006

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.