Closed Bug 410295 Opened 15 years ago Closed 15 years ago

Report cycle collector faults to observer service

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Like so (obsolete) — Splinter Review
This came up the other day... two months ago.  I'm lame.

This patch dispatches an nsIObserverService notification with the cycle-collector-fault topic.  That should allow someone to create an extension that watches for faults and notifies the user, so if some site causes a fault we can pin it down.
Attachment #294928 - Flags: superreview?(peterv)
Attachment #294928 - Flags: review?(peterv)
I had whipped up a barebones extension for this...

http://people.mozilla.org/~dolske/tmp/cyclefault-0.1-test.xpi

It actually just observes offline notifications, for testing, but that's trivial to change.
That's the extension I used to test, actually, with a change to the maxVersion and the notification observed.  Oddly, the init() method in the extension only got called on the first startup after the extension was installed, so that was the only time it got installed as an observer...
Comment on attachment 294928 [details] [diff] [review]
Like so

>Index: xpcom/base/nsCycleCollector.cpp
>===================================================================

>+    NS_IMETHOD Run() {

Nit: brace on new line.
Attachment #294928 - Flags: superreview?(peterv)
Attachment #294928 - Flags: superreview+
Attachment #294928 - Flags: review?(peterv)
Attachment #294928 - Flags: review+
Comment on attachment 294928 [details] [diff] [review]
Like so

Requesting approval.  This is very safe and might help people debug cycle collector issues in opt builds.
Attachment #294928 - Flags: approval1.9?
Comment on attachment 294928 [details] [diff] [review]
Like so

Can we dump a message into the error console?
Attachment #294928 - Flags: approval1.9? → approval1.9+
Sure thing.
Attachment #294928 - Attachment is obsolete: true
Checked in.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee: nobody → bzbarsky
You need to log in before you can comment on or make changes to this bug.