Re: Fwd: Gitweb error
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jan 29, 2012, 00:37 UTC
- Message-ID
- <201201290137.17556.jnareb@gmail.com>
- In-Reply-To
- <CA+EqV8w5qz+iwg_PPB4M5Q-LS48B=yncR9UdR-r58BLtAEPPrA@mail.gmail.com>
On Fri, 27 Jan 2012, rajesh boyapati wrote:
> On Fri, Jan 27, 2012 at 3:39 PM, Jakub Narebski <jnareb@gmail.com> wrote: > > rajesh boyapati <boyapatisrajesh@gmail.com> writes:
Show 6 quoted lines
> > > When I go to one of the projects in gerrit through gitweb and when I > > > click "summary", I am getting the below error. > > > If I click other tabs(log, shortlog, commit, tree,etc) after clicking > > > "summary", I am getting following error in error-log. > > > If I click other tabs(log, shortlog, commit, tree,etc) before clicking > > > "summary", everything works fine.
It is strange that you get an intermittent error like this, and make it even harder to debug - HTTP is stateless.
Show 22 quoted lines
> > > Error:
> > > =================================================================
> > > [2012-01-25 18:50:32,334] ERROR
> > > com.google.gerrit.httpd.gitweb.GitWebServlet : CGI: [Wed Jan 25
> > > 18:50:32 2012] gitweb.cgi: Use of uninitialized value $head in string
> > > eq at /usr/lib/cgi-bin/gitweb.cgi line 4720.
> >
> > Could you show this line and about 3 lines of context in your
> > gitweb.cgi?
> >
>
> my $alternate = 1;
> for (my $i = $from; $i <= $to; $i++) {
> my $entry = $headlist->[$i];
> my %ref = %$entry;
> my $curr = $ref{'id'} eq $head;
> if ($alternate) {
> print "<tr class=\"dark\">\n";
> } else {
> print "<tr class=\"light\">\n";
> }
> $alternate ^= 1;Hmmmm... I see that we do not check if $head is defined here before using it. This can happen legitimately if we are on yet to be born orphan branch (so $head, which should be named $head_at, is undefined) but there exist other branches (so $headlist is not empty).
But I don't think it is what happened in your case, is it?
[...]
-- Jakub Narebski Poland