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

Re: The easiest core dump

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-22 13:44:13 CET

Blair Zajac wrote:
> I'm surprised this one hasn't been found yet.
>
> $ svn log file://
> svn:
> /var/rdiff-backups/blair/packaging/svn/subversion-1.3.0/subversion/libsvn_subr/path.c:377:
> svn_path_basename: Assertion `is_canonical (path, len)' failed.
> Aborted (core dumped)

As Peter indicated, it has been found. A partial fix was applied and, in the
trunk, "file://" fails gracefully, but a quick test just now shows that it
fails in the wrong way (regarding that as a local path rather than a URL), and
anyway "file:///" still crashes. It seems to be a fault in making/checking a
"canonical" URL.

$ svn log file://
svn: 'file:' is not under version control
$ svn log file:///
[...]svn_path_basename: Assertion `is_canonical(path, len)' failed.
Aborted
$ svnversion .
18553M (my modifications are not related to this issue)

To provide a starting point for continuing the discussion, this is what I last
wrote about it in issue #2116
<http://subversion.tigris.org/issues/show_bug.cgi?id=2116>:

------- Additional comments from Julian Foad Mon Aug 1 08:59:47 -0800 2005

The patch to fix the assertion failure by correcting svn_path_is_url() has
already been applied.

I am now attaching a patch to fix the remaining issue which is correcting
svn_path_canonicalize(), with a regression test and some other related tests.
This patch is extracted from Uwe Zeisberger's latest patch, updated to apply to
the current head of trunk, with the log message and whitespace tweaked by me.

I have one concern: the patch accepts an empty hostname, which is fine for
"file:///", but asks in a comment, "Can URIs of other types have an empty host?"
  It allows "http://" which causes an empty host name to be looked up on the
network (as far as I can tell from a quick manual test). This results in the
following error message:

$ svn ls http://
svn: PROPFIND request failed on '/'
svn: PROPFIND of '/': Could not resolve hostname `': Host not found (http://)

Previously, this resulted in a perhaps incorrect error, but with no network access:

$ svn ls http://
svn: 'http:' has no URL

I'm not sure that allowing "http://" through to a network look-up is acceptable.

------- Additional comments from Julian Foad Mon Aug 1 09:01:40 -0800 2005

Created an attachment (id=497)
Patch for svn_path_canonicalize() to allow an empty hostname, e.g. "file://".

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 22 13:45:57 2006

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