Closed Bug 550966 Opened 15 years ago Closed 15 years ago

'Deep recursion on subroutine' if there are compilation errors in the extension code.

Categories

(Bugzilla :: Extensions, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: timello, Assigned: mkanat)

Details

Attachments

(2 files)

If an extension is deployed with compilation errors, it breaks the webserver consuming a lot of CPU. It is quite dangerous, if the extension is deployed in a production server and it contains compilation errors. Also, it turns the debug harder. We should avoid this recursion somehow. Here are the apache logs: [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Install::Util::extension_requirement_packages" at Bugzilla/Install/Util.pm line 393. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::template" at Bugzilla/Error.pm line 91. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Template::create" at Bugzilla.pm line 179. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Template::_include_path" at Bugzilla/Template.pm line 795. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::extensions" at Bugzilla/Install/Util.pm line 156. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Extension::load_all" at Bugzilla.pm line 200. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Extension::load" at Bugzilla/Extension.pm line 128. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Error::ThrowCodeError" at Bugzilla/Extension.pm line 67. [Mon Mar 8 16:33:49 2010] admin.cgi: Deep recursion on subroutine "Bugzilla::Error::_throw_error" at Bugzilla/Error.pm line 144.
Summary: 'Deep recursion on subroutine' if there is a compilation errors in the extension code. → 'Deep recursion on subroutine' if there are compilation errors in the extension code.
Hey Max, Any thought?
There is code in the template hooks to prevent this. Are you sure you haven't modified that code?
Tiago Windows has this issue or similar under Mod_Perl, though as Max mentioned it was fixed. Can you provide detail for you server configs?
Max, I haven't modified anything. It is the trunk code. Michael, I'm running it on Ubuntu 9.10, in order to reproduce the error I can just add a 'use Foo::Bar;' which is an invalid package, that is, any code error can cause that recursion.
Forgot to mention, the code error is in the extension, Extension.pm for instance.
But, the recursion starts when I try to access the page which is 'calling' the hook directly. If I access any other page, it works.
Hmm, okay. Do you have a Config.pm in your extension, or not? I can look into this.
Hmm. Not sure why, but I found the real steps to reproduce: 1. Create an empty extension using './extensions/create.pl Test'; 2. Edit the extensions/Test/Extension.pm and add any code error; 3. Try to access admin.cgi. Then you get the recursion.
The problem seems to be in admin.cgi
Attached patch an example.Splinter Review
hmm.. it happens with any page.
Sorry, for the spams, just posting my investigations. Well, I can reproduce it on the Example extension. But, somehow, it works when I access page.cgi?id=example.html or index.cgi, but not for query.cgi, admin.cgi, report.cgi, show_bug.cgi, buglist.cgi...
Attached patch v1Splinter Review
Okay, this fixes it. The problem was that calling eval { Bugzilla->extensions } was somehow hiding the syntax error and then getting into a crazy infinite loop. So instead, I check if Bugzilla.pm is loaded, which is better anyway. (I don't do "require Bugzilla" because that would skip the extension_requirement_packages code during checksetup.pl if Bugzilla.pm could be loaded.)
Assignee: extensions → mkanat
Status: NEW → ASSIGNED
Attachment #431624 - Flags: review+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Install/Util.pm Committed revision 7060. Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/ modified Bugzilla/Install/Util.pm Committed revision 7029.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: approval3.6+
Flags: approval+
Target Milestone: --- → Bugzilla 3.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: