git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
J.H. <warthog9@kernel.org>
Date
Mar 2, 2011, 01:06 UTC
Message-ID
<4D6D97FB.3050106@kernel.org>
In-Reply-To
<20110301222141.GB7918@elie>
On 03/01/2011 02:21 PM, Jonathan Nieder wrote:
Show 58 quoted lines
> (resending, censored for vger; sorry for the noise)
> Hi Jakub et al,
> 
> Uwe Kleine-König wrote [1]:
> 
>> 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
>>
>> 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.  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.
> 

As a general note the cloud tags code that's there has a whole slew of problems, including a pretty trivial way to crash gitweb entirely if the tags file is malformed in any way to what it's expecting.

I've said it before, I'd rather see that code reverted or completely overhauled, and as far as I know repo.or.cz is the only place even using the code at all.

I also think I reported this particular error a couple of years ago (with the file being malformed and causing all kinds of problems). The fact that the tags don't follow the repository when it's cloned more or less makes this entire feature a giant PITA, couple that with no good documentation on how to create the tag files (I think the file itself needs to have filename of tag, and *ONLY* contain 1 for it's contains for it to work)

Linux: 1 EOF

- John 'Warthog9' Hawley
Previous: Uwe Kleine-KönigNext: Jakub Narebski
Message 5 of 16 in “gitweb: cloud tags feature produces malformed XML for errors”
  1. Jonathan NiederMar 1, 2011
  2. Jakub NarebskiMar 2, 2011
  3. Jakub NarebskiMar 2, 2011
  4. Uwe Kleine-KönigMar 2, 2011
  5. J.H.Mar 2, 2011
  6. Jakub NarebskiMar 2, 2011
  7. Uwe Kleine-KönigMar 2, 2011
  8. Jakub NarebskiMar 3, 2011
  9. Uwe Kleine-KönigMar 3, 2011
  10. gitweb: Change the way "content tags" ('ctags') are handledJakub Narebski, Mar 7, 2011
  11. 2/1 gitweb: Mark matched 'ctag' / contents tag (?by_tag=foo)Jakub Narebski, Mar 9, 2011
  12. Petr BaudisMar 9, 2011
  13. gitweb: do misparse nonnumeric content tag files that contain a digitJonathan Nieder, Jun 9, 2011
  14. Jonathan NiederJun 9, 2011
  15. Petr BaudisMar 3, 2011
  16. Jakub NarebskiMar 3, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.