git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	admin@repo.or.cz, "John Hawley" <warthog9@kernel.org>,
	"Petr Baudis" <pasky@suse.cz>
Subject: Re: gitweb: cloud tags feature produces malformed XML for errors
Date: Wed, 2 Mar 2011 01:05:00 +0100	[thread overview]
Message-ID: <201103020105.04440.jnareb@gmail.com> (raw)
In-Reply-To: <20110301222141.GB7918@elie>

On Tue, 1 Mar 2011, Jonathan Nieder wrote:
> Uwe Kleine-König wrote [1]:
> [1] http://bugs.debian.org/616005

> > I experiment with $feature{'ctags'}.  After installing
> > libhtml-tagcloud-perl (0.34-1) and adding
> >
> >	$feature{'ctags'}{'default'} = [1];
> >
> > to gitweb.conf and doing
> >
> > 	mkdir ctags
> > 	echo Linux > ctags/Linux

This is invalid usage.  See below for details.

> >
> > in the only repository served by gitweb makes iceweasel barf on the
> > output (see attachment).
> 
> With chromium I get:
> 
> 	This page contains the following errors:
> 
> 	error on line 26 at column 6: XML declaration allowed only at the start of the document
> 	Below is a rendering of the page up to the first error.
> 
> First, we hit
> 
> 	if ($show_ctags) {
> 		my %ctags;
> 		foreach my $p (@projects) {
> 			foreach my $ct (keys %{$p->{'ctags'}}) {
> 				$ctags{$ct} += $p->{'ctags'}->{$ct};
> 
> which produces a warning warning in error.log:
> 
> 	index.cgi: Argument "Linux" isn't numeric in addition (+) at /usr/share/gitweb/index.cgi line 4819.
> 
> in error.log.

Well, blame Pasky for not describing 'ctags' in more detail.  Value of
tag is its weight, so instead of

 	mkdir ctags
	echo Linux > ctags/Linux

one should use

 	mkdir ctags
	echo 1 > ctags/Linux

Admittedly gitweb should be more defensive about invalid input...

> Then we hit git_show_project_tagcloud, which dies in 
> "$cloud->html_and_css($count);" with
> 
> 	HTML::TagCloud..
> 	index.cgi: Can't take log of 0 at /usr/share/perl5/HTML/TagCloud.pm line 67.
> 
> For some reason, the result is an _embedded_ error page:
> 
> 	<form method="get" action="/gitweb/" enctype="application/x-www-form-urlencoded"> 
> 	<p class="projsearch">Search:
> 	<input type="text" name="s"  /> 
> 	</p> 
> 	</form> 
> 	Content-type: {a content type which shall not be named}
> 	 
> 	<?xml version="1.0" encoding="utf-8"?> 
>  [...]
> 	500 - Internal Server Error
> 
> So I suspect there are two bugs here.

This I think is caused by the fact that error ("die") occurs after gitweb
have send some output to web browser already.  That would be harder to fix.


-- 
Jakub Narebski
Poland

  reply	other threads:[~2011-03-02  0:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110301190229.11297.17767.reportbug@cassiopeia.kleinek>
2011-03-01 22:21 ` gitweb: cloud tags feature produces malformed XML for errors Jonathan Nieder
2011-03-02  0:05   ` Jakub Narebski [this message]
2011-03-02  8:24     ` Jakub Narebski
2011-03-02  8:45       ` Uwe Kleine-König
2011-03-02  1:06   ` J.H.
2011-03-02 21:18     ` Jakub Narebski
2011-03-02 21:55       ` Uwe Kleine-König
2011-03-03  0:42         ` Jakub Narebski
2011-03-03  8:19           ` Uwe Kleine-König
2011-03-07 18:00             ` [RFC/PATCH] gitweb: Change the way "content tags" ('ctags') are handled Jakub Narebski
2011-03-09 14:04               ` [PATCH 2/1] gitweb: Mark matched 'ctag' / contents tag (?by_tag=foo) Jakub Narebski
2011-03-09 14:09                 ` Petr Baudis
2011-06-09  7:08               ` [PATCH] gitweb: do misparse nonnumeric content tag files that contain a digit Jonathan Nieder
2011-06-09  7:11                 ` Jonathan Nieder
2011-03-03 11:58       ` gitweb: cloud tags feature produces malformed XML for errors Petr Baudis
2011-03-03 13:29         ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201103020105.04440.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=admin@repo.or.cz \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=pasky@suse.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=warthog9@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).