Error upgrading Bugzilla to version 2.23.2+ with perl 5.8.0

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
Installation & Upgrading
--
major
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: Ranzinza, Assigned: Frédéric Buclin)

Tracking

2.23
Bugzilla 3.0
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4

After execute the ./checksetup.pl this show error:
*** This is Bugzilla 2.23.2+ on perl 5.8.0 ***

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.52
Checking for             CGI (v2.93)   ok: found v3.04
Checking for    Data::Dumper (any)     ok: found v2.12
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.42
Checking for      File::Spec (v0.84)   ok: found v0.87
Checking for      File::Temp (any)     ok: found v0.14
Checking for        Template (v2.08)   ok: found v2.13
Checking for      Text::Wrap (v2001.0131) ok: found v2001.0929
Checking for    Mail::Mailer (v1.67)   ok: found v1.67
Checking for    MIME::Base64 (v3.01)   ok: found v3.05
Checking for    MIME::Parser (v5.406)  ok: found v5.406
Checking for        Storable (any)     ok: found v2.06

You need one of the following DBD modules installed, depending on
which database you are using with Bugzilla:
Checking for         DBD::Pg (v1.45)    not found
Checking for      DBD::mysql (v2.9003) ok: found v2.9003

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.12
Checking for     Chart::Base (v1.0)    ok: found v2.3
Checking for       XML::Twig (any)     ok: found v3.09
Checking for  LWP::UserAgent (any)     ok: found v2.001
Checking for       GD::Graph (any)     ok: found v1.43
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)     ok: found v6.2.4

Unquoted string "in" may clash with future reserved word at Bugzilla/Auth.pm line 204.
Bareword found where operator expected at Bugzilla/Auth.pm line 206, near "--you"
        (Missing operator before you?)
Bareword found where operator expected at Bugzilla/Auth.pm line 206, near "do that by"
        (Do you need to predeclare do?)
Bareword found where operator expected at Bugzilla/Auth.pm line 208, near "create new"
        (Do you need to predeclare create?)
Semicolon seems to be missing at Bugzilla/Auth.pm line 212.
Bareword found where operator expected at Bugzilla/Auth.pm line 227, near "<Bugzilla::Auth> object"
        (Missing operator before object?)
String found where operator expected at Bugzilla/Auth.pm line 228, near "the "Info Getter,""
        (Do you need to predeclare the?)
Bareword found where operator expected at Bugzilla/Auth.pm line 228, near ""Info Getter," the"
        (Missing operator before the?)
String found where operator expected at Bugzilla/Auth.pm line 228, near "the "Verifier,""
        (Do you need to predeclare the?)
String found where operator expected at Bugzilla/Auth.pm line 229, near "Mechanism.""
  (Might be a runaway multi-line "" string starting on line 228)
        (Missing semicolon on previous line?)
Semicolon seems to be missing at Bugzilla/Auth.pm line 230.
Bareword found where operator expected at Bugzilla/Auth.pm line 231, near "<login> function"
        (Missing operator before function?)
Bareword found where operator expected at Bugzilla/Auth.pm line 235, near "<Bugzilla::Auth::Login> object"
        (Missing operator before object?)
Bareword found where operator expected at Bugzilla/Auth.pm line 238, near "<user_id> is"
        (Missing operator before is?)
Semicolon seems to be missing at Bugzilla/Auth.pm line 240.
Bareword found where operator expected at Bugzilla/Auth.pm line 242, near "<user_id> from"
        (Missing operator before from?)
Search pattern not terminated at Bugzilla/Auth.pm line 245.
Compilation failed in require at Bugzilla.pm line 29.
BEGIN failed--compilation aborted at Bugzilla.pm line 29.
Compilation failed in require at ./checksetup.pl line 516.
BEGIN failed--compilation aborted at ./checksetup.pl line 521.


Reproducible: Always

Steps to Reproduce:
1. update via cvs
2. run ./checksetup.pl
Actual Results:  
the error listed on Details.


this is an upgrading from a previous version of Bugzilla 2.22.

Comment 1

12 years ago
Okay. This is some weird problem with a base perl 5.8.0. It doesn't happen with the Red Hat perl 5.8.0, because that's been patched.

I know that wicked can reproduce this. But basically, it's a bug in perl. Somehow it's not parsing the POD correctly.

There's a chance we can work around it, but I need to know what the bug *is*, and I don't know.
Severity: critical → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Version: unspecified → 2.23

Updated

12 years ago
Summary: Error upgrading Bugzilla to version 2.23.2+ → Error upgrading Bugzilla to version 2.23.2+ with perl 5.8.0
(Assignee)

Comment 2

12 years ago
OK, I discussed this problem on IRC in #perl, and the problem seems to be due to switch():

(13:37:17) LpSolit: anyone knows if Perl 5.8.0 has parsing bugs?
(13:37:39) Ikarus: LpSolit: not any knwon ones
(13:38:08) b_jonas: LpSolit: I think there's one with qw
(13:38:46) b_jonas: I'm not sure though
(13:38:51) LpSolit: Ikarus, b_jonas: http://lxr.mozilla.org/mozilla/source/webtools/bugzilla/Bugzilla/Auth.pm
(13:39:21) LpSolit: Ikarus, b_jonas: when compiled with Perl 5.8.0, we get errors, see http://tinderbox.mozilla.org/showbuilds.cgi?tree=Bugzilla
(13:39:34) LpSolit: the Perl 5.8.0 etlicon box is burning
(13:39:50) LpSolit: if you click the "L!" link, you will see the error message
(13:39:57) Ikarus: LpSolit: I will check after I get my daily shot of digicrack
(13:40:05) LpSolit: Ikarus: ok
(13:40:56) mauke: looks like it's trying to run the POD
(13:41:32) Ikarus: Looks like it
(13:42:40) b_jonas: LpSolit: which L! exactly?
(13:43:02) mauke: http://tinderbox.mozilla.org/showlog.cgi?log=Bugzilla/1152600608.30940.gz&fulltext=1
(13:43:26) LpSolit: b_jonas: the one mauke pasted here
(13:43:29) mauke: the line numbers are totally off
(13:43:55) Ikarus: mauke: no, they are not
(13:43:58) LpSolit: b_jonas: that's the upper one in the "perl5.8.0 linux etlicon" column
(13:44:23) LpSolit: "View Brief Log" can also be used to only see the error
(13:44:37) LpSolit: mauke: yes, exactly
(13:44:42) LpSolit: mauke: no idea why
(13:45:17) Ikarus: LpSolit: my best guess would be a run away quote or something
(13:45:25) Ikarus: But it doesn't make sense
(13:45:42) Ikarus: LpSolit: which was the last version that ran succesfully ?
(13:46:50) mauke: LpSolit: hah, got it
(13:47:01) mauke: WHY THE FUCK ARE YOU USING Switch IN PRODUCTION CODE
(13:47:07) Ikarus: ah
(13:47:23) Ikarus: That is asking for trouble considering it is implemented using a source filter
(13:48:39) LpSolit: mauke: that's the first time we use Switch
(13:48:52) LpSolit: what's wrong with it? :)
(13:48:53) Ikarus: LpSolit: read the docs next time
(13:49:00) Ikarus: LpSolit: it doesn't work reliably
(13:49:05) mauke: LpSolit: dude, it's a source filter
(13:49:15) Ikarus: LpSolit: it is implemented using a source filter, source filters are not a good idea
(13:50:18) Ikarus: LpSolit: see the part in the doc on Switch that says:
(13:50:18) Ikarus: BUGS
(13:50:19) Ikarus:        There are undoubtedly serious bugs lurking somewhere in code this funky
(13:50:19) Ikarus:        :-) Bug reports and other feedback are most welcome.
(13:50:37) Ikarus: And the author isn't kidding
(13:51:05) LpSolit: Ikarus: what do you suggest to use instead of Switch?
(13:51:24) Ikarus: hold on
(13:51:26) mauke: LpSolit: run this and see for yourself: perl -MO=Deparse -MSwitch  -e 'switch ($fail_code) { case AUTH_ERROR { do_one_thing() } case [FOO, BAR] { do_other_thing(); } else { throw_error(); } }'
(13:52:17) LpSolit: here is how we did till now: http://lxr.mozilla.org/mozilla/source/webtools/bugzilla/process_bug.cgi#999
(13:52:34) Ikarus: LpSolit: how about a for loop on a hash of tests and subs to do when they succeed ?
(13:52:45) Ikarus: LpSolit: that is how I did it last time
(13:53:24) Ikarus: LpSolit: or do you always last ?
(13:53:41) b_jonas: or just an if-elseif
(13:53:53) Ikarus: anyway, switch does not work end of story
(13:53:59) LpSolit: the if-elsif way is not very nice :)
(13:54:06) LpSolit: Ikarus: ok :)
(13:54:10) b_jonas: depends
(13:54:16) Ikarus: LpSolit: well, neither is a broken implementation of Switch
(13:55:02) b_jonas: the problem with a hash or something of subs is that either the subs are not closures or you have to create the whole hash of closures anew every time which completely eliminates the advantage of the hash
(13:59:13) LpSolit: b_jonas, Ikarus: ok, we will remove switch() from our code
(13:59:20) LpSolit: actually, only Auth.pm uses it
(14:00:10) Ikarus: Bugzilla, now with less voodoo
(14:03:40) LpSolit: here is the status of our boxes when we added switch() : http://tinderbox.mozilla.org/showbuilds.cgi?tree=Bugzilla&hours=24&maxdate=1147477340 :)
(14:03:52) LpSolit: many things were burning ;)
(14:04:17) Ikarus: I still need to set up such a thing
(14:04:30) Ikarus: though I actually bought a rotating led display to hook it up to :)
(14:04:40) LpSolit: but the patch we committed was so huge that it was pretty hard to know what caused the problem
(14:05:22) Ikarus: LpSolit: next time, read before using something language extending like Switch
(14:05:49) Ikarus: LpSolit: because most of those are not implemented without source filters


As I said in #perl, Auth.pm is the single file using switch(), and they all complained that switch() was broken. Let's remove it.
Target Milestone: --- → Bugzilla 2.24
Cool, so my perl5.8.0 build is not to blame after all. It's Switch.pm and source filters in perl itself that are buggy. I probably didn't backport some RH patch to 5.8.0 from 5.8.5+ builds. That's the only explanation I can think of on why they are not affected by this.

My vote to remove and ban using Switch because it's clearly way too unstable.

Comment 4

12 years ago
Okay. Just eliminate it in such a way that the code stays clean and readable.
FWIW, I just rebuilt perl 5.8.0 used by our tinderboxen using patches from RH9 perl 2:5.8.0-90.0.13 RPM (Fedora Legacy) and it didn't help. However, this seems to have fixed the c0c0 bug in 2.20 and 2.22 branches. :)
(Assignee)

Comment 6

12 years ago
Created attachment 228930 [details] [diff] [review]
patch, v1

switch() uses if-elsif internally. Let's use it explicitly here.
Assignee: installation → LpSolit
Status: NEW → ASSIGNED
Attachment #228930 - Flags: review?(wicked+bz)
Comment on attachment 228930 [details] [diff] [review]
patch, v1

This does indeed fix the error and code doesn't look any worse in my option. Actually might even be better this way. :)
Attachment #228930 - Flags: review?(wicked+bz) → review+
Flags: approval?
Flags: approval? → approval+
(Assignee)

Comment 8

12 years ago
Checking in Bugzilla/Auth.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Auth.pm,v  <--  Auth.pm
new revision: 1.20; previous revision: 1.19
done
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.