You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Küng <to...@gmail.com> on 2006/07/31 16:37:46 UTC

svn_client_commit3() endless loop with memory leak

Hi,

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:
D:/tttt
D:/tttt/test.txt

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')
                 abort();

               APR_ARRAY_PUSH(dirs_to_lock,
                              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.

Stefan

-- 
        ___
   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

RE: svn_client_commit3() endless loop with memory leak

Posted by Lieven Govaerts <lg...@mobsol.be>.
Stefan, 

> -----Original Message-----
> From: Stefan Küng [mailto:tortoisesvn@gmail.com] 
> Sent: maandag 31 juli 2006 19:20
..
> 
> This can be easily reproduced with the command line client too:
> 
> svn ci D:\tttt D:\tttt\test.txt -m "" -N
> 
> of course, you need a working copy at that location.

That looks like issue 2576:
http://subversion.tigris.org/issues/show_bug.cgi?id=2576.

It was fixed in r20276 on trunk, but I forgot to propose it for backport to
1.4. I'll do that tonight.

regards,

Lieven.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: svn_client_commit3() endless loop with memory leak

Posted by Stefan Küng <to...@gmail.com>.
On 7/31/06, Stefan Küng <to...@gmail.com> wrote:

> 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:
> D:/tttt
> D:/tttt/test.txt
[snip]

This can be easily reproduced with the command line client too:

svn ci D:\tttt D:\tttt\test.txt -m "" -N

of course, you need a working copy at that location.

Stefan

-- 
       ___
  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