Closed Bug 97657 Opened 23 years ago Closed 23 years ago

bug_form_pl_sillyness() used in defparams.pl causes subroutine redefined error

Categories

(Bugzilla :: Bugzilla-General, defect, P2)

2.15
x86
Linux

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: ddkilzer, Assigned: ddkilzer)

Details

==> /var/log/apache/bugzilla.lubricants-oil.com/error.log <==
Subroutine bug_form_pl_sillyness redefined at
	/usr/lib/bugzilla/lib/perl5/bug_form.pl line 34 (#1)
    
    (W redefine) You redefined a subroutine.  To suppress this warning, say
    
        {
    	no warnings;
    	eval "sub name { ... }";
        }
    
[Thu Aug 30 14:13:20 2001] show_bug.cgi: Subroutine bug_form_pl_sillyness
redefined at /usr/lib/bugzilla/lib/perl5/bug_form.pl line 34.

Simply change bug_form_pl_sillyness() to defparams_pl_sillyness()
to fix the issue:

diff -u defparams.pl.orig defparams.pl
--- defparams.pl.orig	Mon Aug 27 09:00:39 2001
+++ defparams.pl	Thu Aug 30 15:01:14 2001
@@ -45,7 +45,7 @@
 # Shut up misguided -w warnings about "used only once".  For some reason,
 # "use vars" chokes on me when I try it here.
 
-sub bug_form_pl_sillyness {
+sub defparams_pl_sillyness {
     my $zz;
     $zz = %::param_checker;
     $zz = %::param_desc;
Target Milestone: --- → Bugzilla 2.16
hmm, wonder why tinderbox didn't catch this?  It smells of a compile time warning...
Keywords: patch, review
Priority: -- → P2
I don't think perl -wc catches duplicate subroutine names through a
'require' statement at compile time.  For example, this "script"
will not generate any error messages with 'perl -wc' for v5.6.0:

#!/usr/bonsai/bin/perl
use strict;
require "defparams.pl";
require "bug_form.pl";
1;

However, if you execute the script, the error message will be caught
at runtime:

foo.pl: Subroutine bug_form_pl_sillyness redefined at bug_form.pl line 34.

I think the reason I caught this sooner was that (1) I was looking at
Apache's error.log file to diagnose another problem and (2) I was using
mod_perl with Apache (which caches subroutine calls and caught the name
collision).  Also, the execution path of show_bug.cgi doesn't normally
require both defparams.pl and bug_form.pl.
Assignee: justdave → ddkilzer
Low risk.
r=jake
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.