Many debug xpcshell-tests show leaks of 1 each of Mutex, ReentrantMonitor, nsTArray_base, nsThread, nsTimerImpl

RESOLVED FIXED in Firefox 12

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: standard8, Assigned: smaug)

Tracking

(Blocks: 1 bug, {mlk, regression})

Trunk
mozilla12
mlk, regression
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(firefox12 fixed, firefox13 fixed)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
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.
(Reporter)

Updated

5 years ago
Blocks: 469523
(Assignee)

Comment 1

5 years ago
So, STR, please.
No longer blocks: 469523
Blocks: 469523
(Reporter)

Comment 2

5 years ago
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.
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.
(Assignee)

Comment 4

5 years ago
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.
(Assignee)

Updated

5 years ago
Assignee: nobody → bugs
(Assignee)

Comment 5

5 years ago
Created attachment 593471 [details] [diff] [review]
patch

Don't create the timer if we're shutting down.
Attachment #593471 - Flags: review?(continuation)
Attachment #593471 - Flags: review?(continuation) → review+
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/mozilla-central/rev/7a33be2b6a36
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
status-firefox12: --- → affected
status-firefox13: --- → fixed
Target Milestone: --- → mozilla13
(Assignee)

Comment 7

5 years ago
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
Attachment #593471 - Flags: approval-mozilla-aurora?
Blocks: 721543
Flags: in-testsuite-
Keywords: mlk

Comment 8

5 years ago
Comment on attachment 593471 [details] [diff] [review]
patch

[Triage Comment]
Approve for Aurora 13 to uncover hidden leaks.
Attachment #593471 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/36476c9edc64
status-firefox12: affected → fixed
Target Milestone: mozilla13 → mozilla12
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.