[PATCH] Fix for crash after deep folder merge
From: Tomasz Poradowski <tomasz_at_poradowski.com>
Date: Thu, 25 Jul 2013 22:50:47 +0200 [[[ 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 <tomasz@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 ... www.poradowski.com ........... :: gsm: +48 509 718 509 .... callto://tomasz_poradowski ...
|
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.