Last Comment Bug 723064 - Many debug xpcshell-tests show leaks of 1 each of Mutex, ReentrantMonitor, nsTArray_base, nsThread, nsTimerImpl
: Many debug xpcshell-tests show leaks of 1 each of Mutex, ReentrantMonitor, ns...
Status: RESOLVED FIXED
[qa-]
: mlk, regression
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: Olli Pettay [:smaug]
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: 469523 721543
  Show dependency treegraph
 
Reported: 2012-02-01 04:48 PST by Mark Banner (:standard8, afk until Dec)
Modified: 2012-03-29 12:39 PDT (History)
5 users (show)
bugzillamozillaorg_serge_20140323: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
fixed


Attachments
patch (688 bytes, patch)
2012-02-01 08:56 PST, Olli Pettay [:smaug]
continuation: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Mark Banner (:standard8, afk until Dec) 2012-02-01 04:48:31 PST
This is a regression from one of these bugs: bug 721543, bug 721548, bug 721515.

When I look in the debug logs post landing, I see the following leak listed:

== BloatView: ALL (cumulative) LEAK STATISTICS, default process 18305

     |<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->|
                                              Per-Inst   Leaked    Total      Rem      Mean       StdDev     Total      Rem      Mean       StdDev
   0 TOTAL                                          21      224     6595        5 (  321.40 +/-   429.36)    17243        2 ( 1810.46 +/-  2094.06)
  34 Mutex                                          12       12       64        1 (   32.25 +/-    18.40)        0        0 (    0.00 +/-     0.00)
  50 ReentrantMonitor                               16       16       15        1 (    6.38 +/-     3.31)        0        0 (    0.00 +/-     0.00)
 168 nsTArray_base                                   4        4      484        1 (  155.02 +/-    66.06)        0        0 (    0.00 +/-     0.00)
 169 nsThread                                      124      124        4        1 (    2.29 +/-     1.11)       66        1 (   15.30 +/-     5.79)
 171 nsTimerImpl                                    68       68        3        1 (    1.40 +/-     0.55)        9        1 (    1.94 +/-     0.75)

This occurs for the majority of the xpcshell-tests given.
Comment 1 Olli Pettay [:smaug] 2012-02-01 07:44:12 PST
So, STR, please.
Comment 2 Mark Banner (:standard8, afk until Dec) 2012-02-01 08:02:13 PST
STR:

1) Build Firefox (or Thunderbird) in debug mode using latest code.
2) run

make -c <objdir> xpcshell-tests

Results:

See the bloat logs in the majority of the results.

Example logs:

https://tbpl.mozilla.org/php/getParsedLog.php?id=9001372&tree=Firefox
https://tbpl.mozilla.org/php/getParsedLog.php?id=9002509&tree=Firefox
https://tbpl.mozilla.org/php/getParsedLog.php?id=9002824&tree=Firefox
https://tbpl.mozilla.org/php/getParsedLog.php?id=9002738&tree=Firefox
https://tbpl.mozilla.org/php/getParsedLog.php?id=9003706&tree=Firefox
https://tbpl.mozilla.org/php/getParsedLog.php?id=9003238&tree=Firefox

Just running xpcshell-tests on my local build of Thunderbird reproduced this. So you shouldn't need to make a packaged test or anything.
Comment 3 Andrew McCreight [:mccr8] 2012-02-01 08:08:06 PST
I guess some of the little marking arrays aren't being cleaned up properly.  I wonder if this is due to some XPCshell weirdness, or because the tests are so short.  With mochitest, many tests are run, so maybe it has proper time to finish up.
Comment 4 Olli Pettay [:smaug] 2012-02-01 08:13:22 PST
XPCShell is in many ways non-normal execution environment, so it is possible that
cycle collector isn't called the same way as in browser.
Comment 5 Olli Pettay [:smaug] 2012-02-01 08:56:18 PST
Created attachment 593471 [details] [diff] [review]
patch

Don't create the timer if we're shutting down.
Comment 6 Olli Pettay [:smaug] 2012-02-01 10:15:16 PST
https://hg.mozilla.org/mozilla-central/rev/7a33be2b6a36
Comment 7 Olli Pettay [:smaug] 2012-02-01 10:30:19 PST
Comment on attachment 593471 [details] [diff] [review]
patch

[Approval Request Comment]
Regression caused by (bug #): bug 721543 
User impact if declined: N/A
Testing completed (on m-c, etc.): Landed m-c
Risk to taking this patch (and alternatives if risky):
Some leaks in Aurora may not be noticed because of this minor (shutdown) leak.
String changes made by this patch: N/A
Comment 8 Alex Keybl [:akeybl] 2012-02-02 07:18:40 PST
Comment on attachment 593471 [details] [diff] [review]
patch

[Triage Comment]
Approve for Aurora 13 to uncover hidden leaks.

Note You need to log in before you can comment on or make changes to this bug.