Closed Bug 400091 Opened 17 years ago Closed 17 years ago

[patch] nsFaviconService leak with rapid page loads

Categories

(Core :: Networking, defect, P4)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: sayrer)

References

Details

(Keywords: memory-leak, testcase)

Attachments

(3 files)

Attached file testcase
Setup:
1. Save the testcase as "fsl.html".
2. export XPCOM_MEM_LEAK_LOG=2

Steps to reproduce:
3. Run a debug build of Firefox with "fsl.html" on the command line.
4. Wait a few seconds for it to finish.
5. Quit.

Result: trace-refcnt reports that nsFaviconService and a bunch of other things have leaked.
Flags: blocking-firefox3?
Attached file what leaked
We fail to open the channel in DoSetAndLoadFaviconForPage

cvs diff isn't working for me right now, but this prevents the leak:

rv = channel->SetNotificationCallbacks(listenerRequestor);
NS_ENSURE_SUCCESS(rv, rv);
rv = channel->AsyncOpen(listener, nsnull);
if (NS_FAILED(rv)) {
  channel->SetNotificationCallbacks(nsnull);return rv;
}

Doesn't seem like it should be necessary, though.
Assignee: nobody → sayrer
We get a cycle here because nsBaseChannel doesn't null out mCallbacks if AsyncOpen fails. 
Assignee: sayrer → nobody
Component: Places → Networking
Flags: blocking-firefox3?
Product: Firefox → Core
QA Contact: places → networking
Assignee: nobody → sayrer
biesi, any reason we can't call SetNotificationCallbacks(nsnull) from nsBaseChannel::AsyncOpen if it takes the failure path?
Flags: blocking1.9?
Flags: blocking1.9? → blocking1.9+
Priority: -- → P4
I'm not sure that that's a good side-effect of asyncOpen, but I guess since you can't do much with a channel when asyncOpen failed that's probably ok.
Attached patch clear mCallbacksSplinter Review
Attachment #297367 - Flags: superreview?(cbiesinger)
Attachment #297367 - Flags: review?(cbiesinger)
Summary: nsFaviconService leak with rapid page loads → [patch] nsFaviconService leak with rapid page loads
Attachment #297367 - Flags: superreview?(cbiesinger)
Attachment #297367 - Flags: superreview+
Attachment #297367 - Flags: review?(cbiesinger)
Attachment #297367 - Flags: review+
I'm curious though, exactly what fails there and why?
Attachment #297367 - Flags: approval1.9?
Attachment #297367 - Flags: approval1.9?
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Depends on: 414484
I don't suppose this could have caused the cb-sea-linux-tbox orange?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: