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

Re: malformed argument re-use in svn_client_url_from_path2

From: Bert Huijben <bert_at_qqmail.nl>
Date: Fri, 25 Oct 2013 15:12:21 +0000

I'm pretty sure you already handle this, but make sure that all paths you pass to Subversion APIs are in theSubversion canonical C:/WD form.


All APIs except for a few conversion APIs in the svn_dirent_* namespace assume canonical paths for their arguments. (There are some legacy conversion APIs in svn_path_*, but I would recommend not using them for new code).


The SharpSvn library I maintain for .NET support on Windows is a bit more friendly here (as are some other bindings), in that it handles the path conversions for you.


      Bert






Sent from Windows Mail





From: Branko Čibej
Sent: ‎Friday‎, ‎October‎ ‎25‎, ‎2013 ‎3‎:‎45‎ ‎PM
To: users_at_subversion.apache.org





On 25.10.2013 14:31, Maximo, Andre (GE Global Research) wrote:
> Thanks Bert again and Ben for joining.
>
> I am handling the error in the code (I just omitted for clarity), but the execution I am describing never throws an error. I also have tested passing the same pool and using the GetBuffer() method, but down to the same segfault at the svn_client_url_from_path2() call. Here is the updated code:
>
> void CVCS::svnURLPath(CString& urlPath, const CString& fullPath)
> {
> CError svnErr;
> const char *url = NULL;
> CString path(fullPath);
> svnErr.err = svn_client_url_from_path2(&url, path.GetBuffer(), m_svn_ctx, m_svn_pool, m_svn_pool);
> if (svnErr.err != NULL)
> throw svnErr;
> if (url != NULL)
> urlPath = CString(url);
> }
>
> When I pass fullPath = "C:\\WD", an error is thrown with the message: "'C:\WD' is not a working copy" (ok here, don't think it was a fluke). I then checkout from the repository to it and update it using SVN api (all ok), now "C:\WD" exists and when I call svnURLPath on it, the url is returned fine.
> I try to find another path inside it, like fullPath = "C:\\WD\\History Items\\Documents\\File.txt". The behavior I expect is an error thrown saying this path does not exist in the repository (because it really still doesn't), but the execution just crashes inside svnURLPath, more specifically in the svn_client_url_from_path2(). (I also tested with a more simple fullPath = "C:\\WD\\Test" and crashes the same). Looking at this function I notice the svn_dirent_get_absolute() call with the same "path_or_url" argument and jumped to the conclusion that this was the problem. But it may well be the second function svn_wc__node_get_url(), getting lost with an unknown path. I am not, maybe it is a Windows specific problem?

Not impossible, though highly unlikely; we'd have noticed that.

I suggest that, instead of guessing, you run this in a debugger so that
you can see exactly where the crash occurs and why. Post the result (the
stack trace with all parameter values, and local variable values at the
point of the crash) to the dev@ list.

-- Brane


--
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2013-10-25 17:19:07 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.