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

RE: [PATCH] Fix for crash after deep folder merge

From: Bert Huijben <bert_at_qqmail.nl>
Date: Sat, 27 Jul 2013 00:15:02 +0200

                Hi,

 

I would guess that you need to disable HTTPv2 or use a Subversion version older than 1.7 to encounter this problem. With HTTPv2 the ‘checkout’ handling during commit has changed.

 

                Bert

 

From: Tomasz Poradowski [mailto:tomasz_at_poradowski.com]
Sent: donderdag 25 juli 2013 22:51
To: dev_at_subversion.apache.org
Subject: [PATCH] Fix for crash after deep folder merge

 

[[[
On the '1.8.0' branch: Don't crash while committing new deep folder branch.

* subversion/libsvn_ra_serf/commit.c
  (checkout_dir): Properly create relative path to newly added folder branch.

Patch by: Tomasz Poradowski <mailto:tomasz_at_poradowski.com> <tomasz_at_poradowski.com>
]]]

Hello Subversion Developers,

I've encountered this problem twice so far using TortoiseSVN client (1.8.0 and trunk), which crashed because of problems in linked Subversion library (1.8.0) - and neither did switching to latest nightly version of TortoiseSVN help nor using Subversion command-line client (1.8.0 and trunk under Cygwin). I tried to isolate the steps to reproduce this problem, but I wasn't able to due to the size and complexity of the merge I was performing (multiple revisions from a branch at once with a multitude of conflicts resolved interactively during merge). One particular outcome of this merge was a deeper folder structure created (with some files in the leaf folder) in target branch and this was the point where Subversion crashed during "svn commit" while adding files. After some investigation it turned out that subversion/libsvn_ra_serf/commit.c/checkout_dir function was passing a NULL pointer to "svn_path_url_add_component2" and running strlen() on it (in some other subroutine) was causing segmentation fault. In the very place where my patch is to be applied there is a simple loop:

  /* Is this directory or one of our parent dirs newly added?
   * If so, we're already implicitly checked out. */
  while (p_dir)
    {
      if (p_dir->added)
        {
          /* Implicitly checkout this dir now. */
          dir->working_url = svn_path_url_add_component2(
                                   dir->parent_dir->working_url,
                                   dir->name, dir->pool);
          return SVN_NO_ERROR;
        }
      p_dir = p_dir->parent_dir;
    }

In my case when a file from leaf folder was being processed - leaf folder was not marked as "added", so it went up to higher levels (2-3 levels up) and when a parent folder with "added" flag was found - its parent folder had an empty "working_url" field.
After applying a fix like in my patch (where I'm creating a relative path when moving up in the folder hierarchy) - I was finally able to commit my changes. Although this patch was created using 1.8.0 branch - I can see that it could be applied to 1.8.1 and latest trunk as well, as nothing has changed in that function recently.

Unfortunately, I can't provide you with the steps to reproduce this. After finally committing my changes I went back to the previous revision and made a merge as before - so I have a copy of that broken state of my repository on my drive - in case you need any more details.

Please CC any replies to me as I'm not subscribed to your list. Thanks in advance!

Regards,
Tomasz Poradowski

-- 
:: tomasz@poradowski.com <mailto:tomasz@poradowski.com>  ... www.poradowski.com <http://www.poradowski.com>  ...........
:: gsm: +48 509 718 509 .... callto://tomasz_poradowski ...
 
Received on 2013-07-27 00:16:01 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.