Closed Bug 1189122 Opened 10 years ago Closed 10 years ago

Assert if Suspect is run when mScanInProgress.

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox41 --- fixed
firefox42 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

nsCycleCollector::Suspect says: "Re-entering ::Suspect during collection used to be a fatal error, but we are canonicalizing nsISupports pointers using QI, so we will see some spurious refcount traffic here." However, the QI to the magic cycle collector values doesn't AddRef, so we may be able to ban this entirely. One instance of this I know of causes a very difficult to analyze leak, bug 1074416. This leak didn't even show up in the XPCOM leak detector because the refcount of the leaking object ended up at zero, it just doesn't get deleted.
This can cause leaks.
Whiteboard: [MemShrink]
This can cause leaks that are invisible to our XPCOM leak detection system. To avoid this, classes should not addref or release in their Traverse methods. With the patch in the blocking bug, try is green. If it doesn't cause intermittent issues, I'll make it a release assert. I can't actually think of a reason why it is bad to call Suspect except when we're actually iterating over the purple buffer, but I guess it doesn't hurt to be more restrictive. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=992761a5cdc3
Attachment #8640884 - Flags: review?(bugs)
Assignee: nobody → continuation
Comment on attachment 8640884 [details] [diff] [review] Assert when we Suspect() when a CC scan is in progress. I think more restrictive is a good thing here. If you need to do some extra Addref/Release during scan, you're probably doing something wrong, as bug 1074416 showed us.
Attachment #8640884 - Flags: review?(bugs) → review+
Bug 1074416 has merged around to inbound now, so this should be okay to land.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Summary: Try to see if we can disallow Suspect when mScanInProgress → Assert if Suspect is run when mScanInProgress.
Comment on attachment 8640884 [details] [diff] [review] Assert when we Suspect() when a CC scan is in progress. Approval Request Comment [Feature/regressing bug #]: old [User impact if declined]: none, the goal is to verify that bug 1074416 is actually working [Describe test coverage new/current, TreeHerder]: there is lots of existing testing of this code. [Risks and why]: very low, this is a debug-only change [String/UUID change made/needed]: none
Attachment #8640884 - Flags: approval-mozilla-aurora?
Comment on attachment 8640884 [details] [diff] [review] Assert when we Suspect() when a CC scan is in progress. Given that this fix helps verify bug 1074416, let's uplift to Aurora.
Attachment #8640884 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: