Bugzilla under mod_perl leaks RAM because of the Bugzilla::Template::_init method

RESOLVED FIXED in Bugzilla 3.4

Status

()

Bugzilla
Bugzilla-General
--
major
RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

3.4.2
Bugzilla 3.4
Bug Flags:
approval +
approval3.4 +
blocking3.4.3 +

Details

Attachments

(1 attachment)

v1
3.88 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

8 years ago
It looks like the way that we set up our custom parser in Bugzilla::Template::_init must set up a circular reference that we don't deal with properly.

Instead of tracing down the circular reference, I discovered that Template Toolkit has supported an ENCODING parameter (at least since 2.15, that's as far back as I checked) but it's actually just not documented until later versions. (It existed in prior versions, though.) Looking over the code, all we have to do is set ENCODING => 'UTF-8' and we should be good to go.
(Assignee)

Comment 1

8 years ago
Created attachment 401747 [details] [diff] [review]
v1

Okay, I tested this and it works.

To test it, add some unicode characters to index.html.tmpl, and then try compiling and loading it with and without the ENCODING argument.
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #401747 - Flags: review?(wurblzap)
Attachment #401747 - Flags: review?(LpSolit)
(Assignee)

Comment 2

8 years ago
Oh, actually, on further investigation, this is our entire memory leak. I'm going to leave the patch here, though.

See bug 517650 for information on how I tracked this down.
Summary: The Bugzilla::Template::_init method causes Bugzilla::Template->create() to leak a small amount of RAM → Bugzilla under mod_perl leaks RAM because of the Bugzilla::Template::_init method
(Assignee)

Updated

8 years ago
Duplicate of this bug: 517650
(Assignee)

Updated

8 years ago
Flags: blocking3.4.3+
(Assignee)

Updated

8 years ago
Severity: minor → major
(Assignee)

Updated

8 years ago
No longer blocks: 517650

Comment 4

8 years ago
Comment on attachment 401747 [details] [diff] [review]
v1

Tested with french and japanese templates on 3.4.2. Works as expected. Great cleanup! r=LpSolit
Attachment #401747 - Flags: review?(wurblzap)
Attachment #401747 - Flags: review?(LpSolit)
Attachment #401747 - Flags: review+

Updated

8 years ago
Flags: approval3.4+
Flags: approval+
(Assignee)

Comment 5

8 years ago
tip:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.108; previous revision: 1.107
done
Removing Bugzilla/Template/Parser.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template/Parser.pm,v  <--  Parser.pm
new revision: delete; previous revision: 1.1
done

3.4:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.99.2.3; previous revision: 1.99.2.2
done
Removing Bugzilla/Template/Parser.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template/Attic/Parser.pm,v  <--  Parser.pm
new revision: delete; previous revision: 1.1
done
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.