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

Re: [PATCH] Fix segfault in repo->wc copy Re: copy repo->wc segmentation fault

From: <alan.wood_at_clear.net.nz>
Date: Wed, 27 Aug 2008 20:21:59 +1200

I have done the same tests with your patch and it seems to work the same as what I
was using.
I have attached my patch which does what you were thinking and doesn't wait for
time stamps. It can't be that important to wait as none of the other error conditions
wait for them.


On 26 Aug 2008 at 16:23, Hyrum K. Wright wrote:

> alan.wood_at_clear.net.nz wrote:
> > I have just traced a bug in the "svn copy URL_at_rev file" command.
> > While following instructions in the svn-book to retrieve a deleted file
> > svn copy svn://fred.ncs.local/ncs/truck/.../a.txt_at_211 a.txt
> > <segmentation fault>
> > This occurred on a Linux machine.
> > I repeated the command from windows command line with the same result.
> >
> > tested on svn version 1.5.1(Linux and win32) and 1.5.x branch(win32)
> >
> > I have traced this through to libsvn_client: copy.c line 1455
> >
> > The return from svn_wc_add_repos_file2() is not checked with SVN_ERR().
> >
> > This fails when the repository name does not exactly match the
> > repository name on the command line.
> > In my case the Linux attempt was different as I used the machines
> > actual name "fred" as opposed to "subversion.ncs.local" which the
> > working copy was built from. On the win32 case I was using a
> > file:///c:/... on the command line, but the working copy was checked
> > out by TortoiseSVN and had file:///C:/... in the working copy.
> >
> > The segmentation fault actually occurs a few lines down when calling
> > extend_wc_mergeinfo() with dst_entry==NULL.
> >
> > After changing to catch the error from the svn_wc_add_repos_file2()
> > I do get an error message about the repositories having different
> > roots which with careful inspection of C vs c may help the user to
> > get it right next time. Would be nicer to to check the repository by
> > uuid rather than name, then check the path within the repository as
> > a string. Or maybe I missed something completely.
> I haven't thoroughly tested this, but figured I'd throw it out here. Alan, if
> you could check and see if this fixes your problem, that'd be great. The patch
> is against trunk, but should apply cleanly against 1.5.x.
> I do wonder why we don't just wrap the call to svn_wc_add_repos_file2 with
> SVN_ERR(). Is there a particular reason why we need to wait for timestamps
> before returning the error?
> -Hyrum
> [[[
> If we can't add the target of the copy to the working copy, don't continue
> trying to calculate mergeinfo based upon the non-existent path. This fixes a
> segfault reported here:
> http://svn.haxx.se/dev/archive-2008-08/0667.shtml
> Found by: Alan Wood <alan.wood_at_clear.net.nz>
> * subversion/libsvn_client/copy.c
> (repos_to_wc_copy_single): Don't continue with mergeinfo calculation if the
> target of the copy couldn't be added to the working copy.
> ]]]

To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-08-27 17:46:50 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.