Closed Bug 1117585 Opened 10 years ago Closed 10 years ago

Disk consumption observers could get released on the cache thread

Categories

(Core :: Networking: Cache, defect)

33 Branch
x86_64
Windows 10
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: neil, Assigned: michal)

Details

Attachments

(2 files)

Attached file Stack backtrace
mozilla::net::CacheIndex::ChangeState clears its list of disk consumption observers. However these observers contain weak references which aren't safe to clear on the cache thread. I'm not sure how I triggered the problem however I'd restarted after turning off e10s in options and the crash happened shortly after I closed the options tab. Stack is from an opt with symbols build so some symbols may have been merged.
Assignee: nobody → michal.novotny
Comment on attachment 8544298 [details] [diff] [review] fix >+ nsIWeakReference *obs; >+ mObserver.forget(&obs); >+ >+ nsCOMPtr<nsIThread> mainThread = do_GetMainThread(); >+ if (mainThread) { >+ NS_ProxyRelease(mainThread, obs); >+ } else { >+ NS_WARNING("Cannot get main thread, leaking weak reference to " >+ "CacheStorageConsumptionObserver."); >+ } It's a shame that NS_ProxyRelease crashes (by attempting to release the weak reference on the wrong thread) if you pass in a null thread otherwise you could just replace this with NS_ProxyRelease(mainThread, mObserver);
Attachment #8544298 - Flags: review?(jduell.mcbugs) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: