Skip Menu |
 

This queue is for tickets about the SVN-Web CPAN distribution.

Report information
The Basics
Id: 24705
Status: stalled
Priority: 0/
Queue: SVN-Web

People
Owner: NIKC [...] cpan.org
Requestors: erich [...] votehere.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: 0_52 provoked an assertion failure in svn
Date: Wed, 31 Jan 2007 15:31:47 -0800
To: <bug-SVN-Web [...] rt.cpan.org>
From: "Eric Hanchrow" <erich [...] votehere.com>
Download (untitled) / with headers
text/plain 508b
This is on FreeBSD 6.2. I've got subversion 1.4.2 installed, from ports. I installed SVN::Web via CPAN. It's perl 5.8.8 I'm not sure exactly what I was doing; I was poking around in my web browser, looking at recent history from our svn repository. I saw this in the console from which I started svnweb-server: Assertion failed: (is_canonical(path, len)), function svn_path_dirname, file subversion/libsvn_subr/path.c, line 365 There's also a big core file from perl, which I can provide if you want.
Download (untitled) / with headers
text/plain 450b
On Wed Jan 31 18:32:03 2007, erich@votehere.com wrote: Show quoted text
> Assertion failed: (is_canonical(path, len)), function > svn_path_dirname, file subversion/libsvn_subr/path.c, line 365
That means that a path that's been passed to the Subversion client library functions isn't correct. This should never happen, and means the test coverage is incomplete. Would you be able to run some tests against your installation, if I provide some additional details?
Download (untitled) / with headers
text/plain 805b
On Mon Apr 09 14:09:46 2007, NIKC wrote: Show quoted text
> On Wed Jan 31 18:32:03 2007, erich@votehere.com wrote:
> > Assertion failed: (is_canonical(path, len)), function > > svn_path_dirname, file subversion/libsvn_subr/path.c, line 365
> > That means that a path that's been passed to the Subversion client > library functions isn't correct. >
I ran across the same bug today. To reproduce it, simply view a revision where the only thing that changed was an svn property on the root level directory. The cause of this bug is the call to $ctx->info() in SVN::Web::Revision::_resolve_changed_paths(), which is done to see whether the current path is a directory or not. When the path is '/', this leads to an extra trailing slash in the first argument to $ctx->info(), which triggers this error. A Patch is attached.
--- Revision.pm.original 2007-08-08 19:24:41.000000000 +0200 +++ Revision.pm 2007-08-08 19:24:41.000000000 +0200 @@ -275,6 +275,11 @@ foreach my $path (keys %{ $data->{paths} }) { $subpool->clear(); + if ($path eq '/') { + $data->{paths}{$path}{isdir} = 1; + next; + } + # Ignore deleted nodes if($data->{paths}{$path}{action} ne 'D') { $ctx->info("$uri$path", $data->{rev}, $data->{rev},
Download (untitled) / with headers
text/plain 226b
I found that the patch mentioned earlier wasn't enough, but if you make sure there are never any trailing slashes in the filename passed to the info() method, then it works (with svn 1.5.3 on Fedora 10). A patch is attached.
diff -ru SVN-Web-0.53-old/lib/SVN/Web/Browse.pm SVN-Web-0.53/lib/SVN/Web/Browse.pm --- SVN-Web-0.53-old/lib/SVN/Web/Browse.pm 2007-04-29 20:22:51.000000000 +0100 +++ SVN-Web-0.53/lib/SVN/Web/Browse.pm 2009-05-11 12:45:24.000000000 +0100 @@ -149,6 +149,7 @@ my $uri = $path eq '/' ? $self->{repos}{uri} : $self->{repos}{uri} . $path; + $uri =~ s{/+\z}{}; my($exp_rev, $yng_rev, $act_rev, $at_head) = $self->get_revs(); diff -ru SVN-Web-0.53-old/lib/SVN/Web/Checkout.pm SVN-Web-0.53/lib/SVN/Web/Checkout.pm --- SVN-Web-0.53-old/lib/SVN/Web/Checkout.pm 2007-04-29 20:22:51.000000000 +0100 +++ SVN-Web-0.53/lib/SVN/Web/Checkout.pm 2009-05-11 12:45:04.000000000 +0100 @@ -68,7 +68,9 @@ my $path = $self->{path}; my $node_kind; - $ctx->info("$uri$path", $rev, $rev, + my $p = $uri . $path; + $p =~ s{/+\z}{}; + $ctx->info($p, $rev, $rev, sub { $node_kind = $_[1]->kind(); }, 0); if($node_kind != $SVN::Node::file) { diff -ru SVN-Web-0.53-old/lib/SVN/Web/Log.pm SVN-Web-0.53/lib/SVN/Web/Log.pm --- SVN-Web-0.53-old/lib/SVN/Web/Log.pm 2007-04-29 20:22:51.000000000 +0100 +++ SVN-Web-0.53/lib/SVN/Web/Log.pm 2009-05-11 12:45:45.000000000 +0100 @@ -231,7 +231,9 @@ # $self->_resolve_changed_paths(); my $is_dir; - $ctx->info("$uri$path", $rev, $rev, + my $p = $uri . $path; + $p =~ s{/+\z}{}; + $ctx->info($p, $rev, $rev, sub { my($path, $info, $pool) = @_; $is_dir = $info->kind() == $SVN::Node::dir; diff -ru SVN-Web-0.53-old/lib/SVN/Web/Revision.pm SVN-Web-0.53/lib/SVN/Web/Revision.pm --- SVN-Web-0.53-old/lib/SVN/Web/Revision.pm 2007-04-29 20:22:51.000000000 +0100 +++ SVN-Web-0.53/lib/SVN/Web/Revision.pm 2009-05-11 12:43:53.000000000 +0100 @@ -275,9 +275,16 @@ foreach my $path (keys %{ $data->{paths} }) { $subpool->clear(); + if ($path eq '/') { + $data->{paths}{$path}{isdir} = 1; + next; + } + # Ignore deleted nodes if($data->{paths}{$path}{action} ne 'D') { - $ctx->info("$uri$path", $data->{rev}, $data->{rev}, + my $p = $uri . $path; + $p =~ s{/+\z}{}; + $ctx->info($p, $data->{rev}, $data->{rev}, sub { $node_kind = $_[1]->kind() }, 0, $subpool); $data->{paths}{$path}{isdir} = $node_kind == $SVN::Node::dir;
Download (untitled) / with headers
text/plain 108b
I doubt youre still interested in this. I will leave this as stalled in case anyone wants to submit a patch.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.