[HTML5][Patch] HTML 5 Parser Tests Expose memory leaks on Tinderbox

RESOLVED FIXED

Status

()

P1
major
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: cmtalbert, Assigned: hsivonen)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

I did a little investigation on this.  After the new HTML 5 parser tests were backed out, I ran the original set of parser tests (test_html5_tree_construction.html) in their original state (without the HTML 5 parser enabled) => no memory leak.  Then I added the following code to enable the HTML 5 parser and re-ran the tests:  352387 bytes leaked.

netscape.security.PrivilegeManager
         .enablePrivilege("UniversalXPConnect");
Components.classes["@mozilla.org/preferences-service;1"]
         .getService(Components.interfaces.nsIPrefBranch)
         .setBoolPref("html5.enable", true);
(Assignee)

Updated

9 years ago
Priority: -- → P1
Summary: HTML 5 Parser Tests Expose memory leaks on Tinderbox → [HTML5] HTML 5 Parser Tests Expose memory leaks on Tinderbox
The original HTML parser tests are still leaking with the HTML 5 parser enabled; this will have to be fixed before the HTML 5 parser can be enabled by default on m-c.  Currently, running the tests yields these leaks:

== BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS

     |<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->|
                                              Per-Inst   Leaked    Total      Rem      Mean       StdDev     Total      Rem      Mean       StdDev
   0 TOTAL                                          27       64  4051408        4 ( 6467.48 +/-  5530.36)  6326856        1 ( 2073.44 +/-  3449.29)
 445 nsHtml5AttributeName                           16       32      588        2 (  294.48 +/-   169.48)        0        0 (    0.00 +/-     0.00)
 448 nsHtml5HtmlAttributes                          24       24      205        1 (    3.12 +/-     1.86)        0        0 (    0.00 +/-     0.00)
 648 nsStringBuffer                                  8        8    88446        1 ( 9876.60 +/-  4361.59)   157043        1 (11973.00 +/-  4844.34)

nsTraceRefcntImpl::DumpStatistics: 831 entries
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 64 bytes during test execution
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 2 instances of nsHtml5AttributeName with size 16 bytes each (32 bytes total)
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 1 instance of nsHtml5HtmlAttributes with size 24 bytes
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 1 instance of nsStringBuffer with size 8 bytes

To repro:

python runtests.py --test-path=parser/htmlparser/tests/mochitest/test_html5_tree_construction.html --setpref=html5.enable=true

It would be nice to fix this sooner, so that the new HTML 5 tests can be enabled on tinderbox and thus would be able to identify regressions; currently, they're not run at all due to this leak.
Created attachment 415538 [details]
testcase (HTML)

Loading this test case (one of the HTML 5 tree construction tests) is enough to trigger the memory leak.
(Assignee)

Comment 4

9 years ago
Created attachment 416367 [details] [diff] [review]
Delete attibutes on end tag
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
(Assignee)

Updated

9 years ago
Summary: [HTML5] HTML 5 Parser Tests Expose memory leaks on Tinderbox → [HTML5][Patch] HTML 5 Parser Tests Expose memory leaks on Tinderbox
(Assignee)

Comment 5

9 years ago
http://hg.mozilla.org/mozilla-central/rev/a2884ae6f7dd
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.