stylo: Figure out why layout/reftests/css-sizing/min-intrinsic-with-max-width-percents-across-form-controls.html leaks

RESOLVED FIXED

Status

()

Core
CSS Parsing and Computation
P2
normal
RESOLVED FIXED
5 months ago
a month ago

People

(Reporter: bz, Unassigned)

Tracking

(Blocks: 2 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox54 affected)

Details

(Whiteboard: [Stylo:blocked])

(Reporter)

Description

5 months ago
Loading layout/reftests/css-sizing/min-intrinsic-with-max-width-percents-across-form-controls.html in a debug stylo build leaks.  At shutdown we get:

  ###!!! ASSERTION: 1 dynamic atom(s) with non-zero refcount: anonymous-div:
  'nonZeroRefcountAtomsCount == 0', file xpcom/ds/nsAtomTable.cpp, line 411

and

  Leaked URLs:
    resource://gre-resources/forms.css

Leak log says:

     |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
     |                                      | Per-Inst   Leaked|   Total      Rem|
   0 |TOTAL                                 |       41      400|  129448        8|
 389 |nsAuthURLParser                       |       24       24|       2        1|
 554 |nsJSPrincipals                        |       24       24|     228        1|
 569 |nsMainThreadPtrHolder<T>              |       24       72|     588        3|
 641 |nsStandardURL                         |      264      264|    1659        1|
 645 |nsStringBuffer                        |        8       16|   22103        2|
(Reporter)

Comment 1

5 months ago
So at a guess, we are leaking a URLValue.  That holds three nsMainThreadPtrHolders (to a principal, base URI, and referrer URI) and a stringbuffer for the url itself.  The nsJSPrincipals is the principal we own, presumably we have no referrer, our base URI is resource://gre-resources/forms.css and holds a second stringbuffer.
(Reporter)

Comment 2

5 months ago
Minimalish leak testcase:

  data:text/html,<input%20type=number>

I did try logging ctor/dtor for URLValueData and we seem to be destroying all the ones we create... unless servo is creating some directly, not via the Gecko ctor/dtor?  Bu I don't think we do that.
(Reporter)

Comment 3

5 months ago
A bit more data:

1)  If I stop creating the -moz-number-text anonymous <input>, the leak goes away.
2)  If I comment out the -moz-binding bit of the "input" styles in forms.css, the leak loses all the
    URL-related and principal-related stuff but we still leak an nsStrinGbuffer and the anonymous-div atom. 
    Presumably the leaked stringbuffer is the one in the atom.
3)  We seem to not leak any nsStyleContext or StyleSheetInfo or URLValueData instances, if I added my
    CTOR/DTOR logging correctly.

Something here is fishy with the pseudo-element bits...
Ok. I'm working on my patches for the pseudo-element bits today, we'll see if the problem persists.
Depends on: 1331047
Priority: -- → P2
Whiteboard: [Stylo:blocked]
Blocks: 1243581
I don't see any leaks on min-intrinsic-with-max-width-percents-across-form-controls.html on today's mozilla-central.  As I wrote bug 1321754 comment 48, I think leaks somewhat related to pseudo elements has gone now.
(Reporter)

Updated

3 months ago
Blocks: 1361235
(Reporter)

Comment 6

2 months ago
So with the patches in bug 1361235 is this fixed at least in terms of the leak?  Can we reenable these tests?

Do we need a followup for us not finding these elements to restyle?
Flags: needinfo?(cam)
The min-intrisic-with-max-width-percents-across-form-controls.html tests have been re-enabled.  I'm looking into the underlying issue of not finding these elements in bug 1364361.
Flags: needinfo?(cam)
Depends on: 1364361
Status: NEW → RESOLVED
Last Resolved: a month ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.