Closed Bug 482236 Opened 13 years ago Closed 13 years ago

negative trace-refcnt "total" confuses runtests.py.in: "missing output line for total leaks!"

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.9.2a1

People

(Reporter: sgautherie, Assigned: sgautherie)

References

()

Details

(Keywords: fixed1.9.1, Whiteboard: [fixed1.9.1b4])

Attachments

(1 file)

{
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.1/1236595575.1236601337.20655.gz
OS X 10.5.2 mozilla-1.9.1 unit test on 2009/03/09 03:46:15

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

     |<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->|
                                              Per-Inst   Leaked    Total      Rem      Mean       StdDev     Total      Rem      Mean       StdDev
   0 TOTAL                                          -6        0 -1246128631        0 (197615.31 +/-     0.00) 1540625252        0 (13864.30 +/-     0.00)
 807 nsRect                                         16        0 -1910456423        0 (717255.44 +/-     0.00)        0        0 (    0.00 +/-     0.00)

nsTraceRefcntImpl::DumpStatistics: 1161 entries
TEST-UNEXPECTED-FAIL | runtests-leaks | missing output line for total leaks!
}

Obviously the 'TOTAL' line is there:
the regexp must be too restrictive.
Ftr, the box turned Orange but didn't report this failure:
this is expected fttb, see bug 473259 (Av1 patch...).

This code will move in bug 469518 (Bv1a patch),
so wait for that before check-in.
Depends on: 473259, 469518
Blocks: 456894
Target Milestone: --- → mozilla1.9.2a1
Assignee: nobody → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #366303 - Flags: review?(dolske)
Attachment #366303 - Flags: review?(dolske) → review?(dbaron)
Attachment #366303 - Flags: review?(jwalden+bmo)
Attachment #366303 - Flags: review?(dbaron)
Attachment #366303 - Flags: review+
Comment on attachment 366303 [details] [diff] [review]
(Av1) Support a negative 'Total' value
[Checkin: See comment 12 & 15]

r=dbaron

However, I don't own this file, so Waldo should review as well.
Very similar case:
{
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1236909599.1236917444.7220.gz
OS X 10.5.2 mozilla-central unit test on 2009/03/12 18:59:59
}
Ftr, this column is
{
http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsTraceRefcntImpl.cpp

206     mTotalLeaked = 0;

305     total->mTotalLeaked += (PRInt32)(mClassSize *
306                                      ((mNewStats.mCreates + mAllStats.mCreates)
307                                       -(mNewStats.mDestroys + mAllStats.mDestroys)));

367               (nsCRT::strcmp(mClassName, "TOTAL"))
368                   ?(PRInt32)((stats->mCreates - stats->mDestroys) * mClassSize)
369                   :mTotalLeaked,

384   PRInt32       mTotalLeaked; // used only for TOTAL entry
}
How do we have more destroys than creates?  How can we have a negative number on a leak test?
In the case in comment 0, I have no idea.

More typically it happens either:
 * because of a bug in instrumentation (e.g., instrumenting some but not all constructors, often because of an implicit copy-constructor)
 * because we actually called an object's destructor twice

But to figure out what happened in comment 0 somebody would need to debug.
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1237094971.1237104878.374.gz#err0

The total number of nsRect objects is reported as negative, but 0 are reported remaining.  Could it be that mochitests create enough nsRect objects to overflow the counter?
Summary: runtests.py.in : wrong leak detection on this case → negative trace-refcnt "total" confuses runtests.py.in: "missing output line for total leaks!"
Blocks: 438871
Whiteboard: [orange]
Filed bug 483500 based on that theory.
(In reply to comment #8)
> http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1237094971.1237104878.374.gz#err0

OS X 10.5.2 mozilla-central unit test on 2009/03/14 22:29:31
Attachment #366303 - Flags: review?(jwalden+bmo) → review+
Attachment #366303 - Attachment description: (Av1) Support a negative 'Total' value → (Av1) Support a negative 'Total' value [Checkin: See comment 12]
Comment on attachment 366303 [details] [diff] [review]
(Av1) Support a negative 'Total' value
[Checkin: See comment 12 & 15]


http://hg.mozilla.org/mozilla-central/rev/95497d18ce82
Av1, with comment 1 suggestion(s),
plus removing a no longer needed |abs()| which I had missed.
Blocks: 483500
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
No longer depends on: 469518
Resolution: --- → FIXED
Whiteboard: [orange] → [needs 1.9.1 landing: after bug 469518] [orange]
No longer blocks: 438871
Whiteboard: [needs 1.9.1 landing: after bug 469518] [orange] → [needs 1.9.1 landing: after bug 469518]
Blocks: 483917
V.Fixed, per bug 483917 comment 0.
No longer blocks: 483917
Status: RESOLVED → VERIFIED
Blocks: 483917
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.5/1237891787.1237897818.12685.gz
OS X 10.5.2 mozilla-1.9.1 unit test on 2009/03/24 03:49:47
Comment on attachment 366303 [details] [diff] [review]
(Av1) Support a negative 'Total' value
[Checkin: See comment 12 & 15]


http://hg.mozilla.org/releases/mozilla-1.9.1/rev/abe9562544ef
Attachment #366303 - Attachment description: (Av1) Support a negative 'Total' value [Checkin: See comment 12] → (Av1) Support a negative 'Total' value [Checkin: See comment 12 & 15]
Flags: in-testsuite-
Keywords: fixed1.9.1
Whiteboard: [needs 1.9.1 landing: after bug 469518] → [fixed1.9.1b4]
You need to log in before you can comment on or make changes to this bug.