Closed Bug 1210128 Opened 9 years ago Closed 9 years ago

Intermittent test_caches.html | application crashed [@ nsRefPtr<mozilla::dom::cache::Context::QuotaInitRunnable>::operator->() const]

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: KWierso, Assigned: bkelly)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

See Also: → 1205201
I see whats going on here.  We clear mInitRunnable in Context::OnQuotaInit() before changing the state from STATE_CONTEXT_INIT to STATE_CONTEXT_READY.  In between those two changes we also check for cancelation and bail out which lets the shutdown code run.
Won't get to this for a few days, but taking it so I don't forget.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Jan, this patch fixes a very rare shutdown crash in Cache API.  Basically we get a failure when opening quota which sends us into this condition:

https://dxr.mozilla.org/mozilla-central/source/dom/cache/Context.cpp?case=true&from=dom%2Fcache%2FContext.cpp#1004

But since we entered it because of the NS_FAILED(), mState has not been updated correctly.  This makes the subsequent shutdown cleanup do bad things with the nullptr mInitRunnable.

I doubt I can provoke on automation anyway, but here is a try to make sure I didn't break something else:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=c16f111b87f2
Attachment #8674280 - Flags: review?(Jan.Varga)
Comment on attachment 8674280 [details] [diff] [review]
bug1210128_cacheshutdown.patch

Review of attachment 8674280 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/cache/Context.cpp
@@ +1000,5 @@
>    // before the Context has gone away.
>    MOZ_ASSERT(!mDirectoryLock);
>    mDirectoryLock = aDirectoryLock;
>  
> +  // If we opening the context failed, but we were not explicitly canceled,

FYI, I fixed the "If we opening" typo in my local copy of the patch.
Attachment #8674280 - Flags: review?(Jan.Varga) → review+
https://hg.mozilla.org/mozilla-central/rev/343408cf3c76
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: