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)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: neil, Assigned: michal)
Details
Attachments
(2 files)
1.16 KB,
text/plain
|
Details | |
1.35 KB,
patch
|
jduell.mcbugs
:
review+
|
Details | Diff | Splinter Review |
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 | ||
Updated•10 years ago
|
Assignee: nobody → michal.novotny
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8544298 -
Flags: review?(jduell.mcbugs)
Reporter | ||
Comment 2•10 years ago
|
||
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);
Updated•10 years ago
|
Attachment #8544298 -
Flags: review?(jduell.mcbugs) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Comment 4•10 years ago
|
||
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.
Description
•