Closed Bug 328739 Opened 19 years ago Closed 15 years ago

duplicates.cgi: Use of uninitialized value in string ne at (eval 23) line 31.

Categories

(Bugzilla :: Reporting/Charting, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jan_janousek, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1 Running collectstats.pl either as a cron job or manually produces an error message (of course a date/time can differ): [Mon Feb 27 00:05:25 2006] duplicates.cgi: Use of uninitialized value in string ne at (eval 23) line 31. Beyond this error message I do not see any buggy behaviour. Reproducible: Always Steps to Reproduce: 1. run collectstats.pl manually, or 2. let cron run collectstats.pl as suggested in <http://www.bugzilla.org/docs/2.20/html/extraconfig.html#AEN628>. Actual Results: An error message appears/is sent by cron (a date/time can differ): [Mon Feb 27 00:05:25 2006] duplicates.cgi: Use of uninitialized value in string ne at (eval 23) line 31. Expected Results: No error message should appear. System: Fedora Core 3 CGI Version: 3.17 (CPAN latest) Bugzilla CVS Tag: BUGZILLA-2_20_1 (with some minor adjustments) The message started to appear after I upgraded Bugzilla to CVS Tag BUGZILLA-2_20_1 and/or required Perl modules to the newest CPAN versions. So it could be possible something changed in the (non-Bugzilla) module CGI.pm (see below)... I tried to track the source of this message down. My way started in collectstats.pl. It led through duplicates.cgi where a line 276: print $cgi->header($format->{'ctype'}); ... revealed as a source of the message. It continued to Bugzilla/CGI.pm where a line 310: return $self->SUPER::header(@_) || ""; ... calls a SUPER's method header. I would say the line should look like this: return($self->SUPER::header(@_) || ""); ... as 'return' tights more than '||' but both variants produce the message. I continued to the (non-Bugzilla) module CGI.pm method header where I lost the track.
perl's CGI.pm expects $ENV{'HTTP_USER_AGENT'} to be set and will throw this error if it isn't, so that's my bet. we should probably set it in collectstats.pl
Actually, the thing we really need to do is make sure that non-CGI scripts don't use CGI.pm. It causes other errors also, anyhow.
Blocks: bz-warnings
(In reply to comment #2) > Actually, the thing we really need to do is make sure that non-CGI scripts > don't use CGI.pm. It causes other errors also, anyhow. > I fully agree. That's why I wrote bug 315605. And I think Search.pm has to be fixed too to stop requiring a CGI object.
(In reply to comment #1) > perl's CGI.pm expects $ENV{'HTTP_USER_AGENT'} to be set and will throw this > error if it isn't, so that's my bet. > > we should probably set it in collectstats.pl CGI.pm (3.17) in sub header does not define $charset in all cases. Then the line 1438 tests $charset ne ''. So a dirty patch for now could be to replace the line 1438 in CGI.pm: $type .= "; charset=$charset" if $type ne '' and $type !~ /\bcharset\b/ and $charset ne ''; ... by ('and defined $charset' added): $type .= "; charset=$charset" if $type ne '' and $type !~ /\bcharset\b/ and defined $charset and $charset ne '';
I'm experiencing the same thing. I tried to find line 1438 in Bugzilla\CGI.pm, but mine only goes to 310 lines. Oddly, collectstats.pl still seems to be collecting data.
OK, it feels like I'm trying to repair a fine wristwatch with a ball-peen hammer, but I'll contribute what I can to this discussion. I found that commenting out line 1438 in my CGI.pm (the one outside the Bugzilla install) has eliminated the error. I guess this qualifies as a workaround, at least for those who have no need of alternate charsets. If someone was willing to point me in the right direction, I'd be happy to build a patch for this in the right place. Should Bugzilla/CGI.pm force charset to be defined?
Assignee: gerv → charting
I cannot reproduce this problem on Bugzilla 3.0.9. And collectstats.pl doesn't call duplicates.cgi anymore since Bugzilla 3.4, see bug 380756. WFM
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.