Closed Bug 1344848 Opened 8 years ago Closed 8 years ago

Don't check for atom leaks unless we're checking for other leaks

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox-esr52 --- fixed
firefox53 --- fixed
firefox54 --- fixed
firefox55 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

It doesn't make sense to check for atom leaks unless we're checking for other leaks, or random things can set it off. For instance, we don't check for leaks in xpcshell. The existing code tries to deal with this by only running if we're in a shutdown GC, which only run in debug builds, but we don't do leak checking for all debug tests, such as xpcshell, so we can hit leaks we don't care about. I think a better thing to check for would be to see if XPCOM_MEM_BLOAT_LOG is set.
Can we do this in a way that it would only affect *test runs* and not other runs of xpcshell? I'm asking because if we did this blindly, it would have masked bug 1343863 which happened during mach package where we run xpcshell. That would be unfortunate as that turned out to be a real leak in our code that would be possible to be hit by a real user.
(In reply to :Ehsan Akhgari from comment #1) > Can we do this in a way that it would only affect *test runs* and not other > runs of xpcshell? No. It just happens that in your case the leak was useful information, but it could have just as easily been a false positive, like you were seeing in a number of other tests.
(In reply to Andrew McCreight [:mccr8] from comment #2) > (In reply to :Ehsan Akhgari from comment #1) > > Can we do this in a way that it would only affect *test runs* and not other > > runs of xpcshell? > > No. It just happens that in your case the leak was useful information, but > it could have just as easily been a false positive, like you were seeing in > a number of other tests. OK, fair enough.
Comment on attachment 8844145 [details] Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. https://reviewboard.mozilla.org/r/117682/#review119412 ::: xpcom/ds/nsAtomTable.cpp:394 (Diff revision 1) > i.Remove(); > delete atom; > ++removedCount; > - } else if (aKind == GCKind::Shutdown) { > - // We only perform these kind of GCs in leak-checking builds. If > - // something is anomalous, then we'll report an error here, and crash > + } > +#ifdef NS_FREE_PERMANENT_DATA > + else if (aKind == GCKind::Shutdown && PR_GetEnv("XPCOM_MEM_BLOAT_LOG")) { Is `XPCOM_MEM_BLOAT_LOG` really the only leak checking env var we have?
(In reply to Eric Rahm [:erahm] from comment #6) > Is `XPCOM_MEM_BLOAT_LOG` really the only leak checking env var we have? There are a hodge-podge of others, which you can see in InitTraceLog(). BLOAT_LOG is the only one we use in testing, I think.
Comment on attachment 8844145 [details] Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. https://reviewboard.mozilla.org/r/117682/#review119416 Discussed in IRC, it should be fine to be less spammy in non-`XPCOM_MEM_BLOAT_LOG` runs. As noted in the comment our assertion still runs and does not rely on `nonZeroRefcountAtoms`.
Attachment #8844145 - Flags: review?(erahm) → review+
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7818d19d769d Don't check for atom leaks unless we're checking for other leaks. r=erahm
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f248e1f814d1 Don't check for atom leaks unless we're checking for other leaks. r=erahm
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Any chance to get this uplifted? That atom leak check was introduced in FF 54 and uplifted to 53 and 52 (incl. 52 ESR). Since despite our best efforts we still have some leaks in TB, we still have failing tests due to this (we fixed 10 of initially 14 broken tests). So uplift at far as possible would be appreciated. It doesn't look like a risky patch at all.
Flags: needinfo?(erahm)
Flags: needinfo?(continuation)
Comment on attachment 8844145 [details] Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. Approval Request Comment [Feature/Bug causing the regression]: bug 1276669 [User impact if declined]: No direct user impact, but this will fix Thunderbird test failures. [Is this code covered by automated tests?]: yes [Has the fix been verified in Nightly?]: yes [Needs manual test from QE? If yes, steps to reproduce]: no [List of other uplifts needed for the feature/fix]: none [Is the change risky?]: no [Why is the change risky/not risky?]: This just weakens a debug-only check. [String changes made/needed]: none
Flags: needinfo?(erahm)
Flags: needinfo?(continuation)
Attachment #8844145 - Flags: approval-mozilla-esr52?
Attachment #8844145 - Flags: approval-mozilla-beta?
Attachment #8844145 - Flags: approval-mozilla-aurora?
Comment on attachment 8844145 [details] Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. Take this to help fix Thunderbird test failures. Aurora54+.
Attachment #8844145 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 8844145 [details] Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. disable a debug-only check in some cases, beta53+, esr52+
Attachment #8844145 - Flags: approval-mozilla-esr52?
Attachment #8844145 - Flags: approval-mozilla-esr52+
Attachment #8844145 - Flags: approval-mozilla-beta?
Attachment #8844145 - Flags: approval-mozilla-beta+
Setting qe-verify- based on Andrew's assessment on manual testing needs (see Comment 14) and the fact that this fix has automated coverage.
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: