Re: gitweb: cloud tags feature produces malformed XML for errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]