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)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: timello, Assigned: mkanat)
Details
Attachments
(2 files)
|
5.79 KB,
patch
|
Details | Diff | Splinter Review | |
|
941 bytes,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
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.
| Reporter | ||
Updated•15 years ago
|
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.
| Reporter | ||
Comment 1•15 years ago
|
||
Hey Max,
Any thought?
| Assignee | ||
Comment 2•15 years ago
|
||
There is code in the template hooks to prevent this. Are you sure you haven't modified that code?
Comment 3•15 years ago
|
||
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?
| Reporter | ||
Comment 4•15 years ago
|
||
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.
| Reporter | ||
Comment 5•15 years ago
|
||
Forgot to mention, the code error is in the extension, Extension.pm for instance.
| Reporter | ||
Comment 6•15 years ago
|
||
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.
| Assignee | ||
Comment 7•15 years ago
|
||
Hmm, okay. Do you have a Config.pm in your extension, or not? I can look into this.
| Reporter | ||
Comment 8•15 years ago
|
||
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.
| Reporter | ||
Comment 9•15 years ago
|
||
The problem seems to be in admin.cgi
| Reporter | ||
Comment 10•15 years ago
|
||
hmm.. it happens with any page.
| Reporter | ||
Comment 11•15 years ago
|
||
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...
| Assignee | ||
Comment 12•15 years ago
|
||
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 | ||
Comment 13•15 years ago
|
||
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
| Assignee | ||
Updated•15 years ago
|
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.
Description
•