Closed Bug 1322346 Opened 8 years ago Closed 8 years ago

Assertion failure: !(mTransactionPump && mCachePump) || mCachedContentIsPartial (RedirectTo, veto, ReadFromCache)

Categories

(Core :: Networking: HTTP, defect)

53 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1322355
Tracking Status
firefox53 --- affected

People

(Reporter: mayhemer, Unassigned)

Details

STR:
- A request that is RedrectTo about:blank from somewhere between AsyncOpen and on-examine-response (Ghostery extension)
- 304 response
- we do an async redirect check (transaction pump is suspended, but cache pump yet doesn't exist)
- the redirect is vetoed

Problem:
- we create cache pump and asyncRead it
- we resume both transaction and cache pump (observed WARNING: NS_ENSURE_TRUE(mSuspendCount > 0) failed: file netwerk/base/nsInputStreamPump.cpp, line 240, apparently for the cache pump)
- we first get onstartrequest from cache pump

Expected:
- we first get onstoprequest from the transaction pump which clears the mTransactionPump member


Solution:
- keep record of attempted cache pump suspension before redirect check and suspend it after creation
- or, use channel->suspend when redirecting (not sure why not used now)
The redirectTo is called via JS hook to onBeforeRequest: return { redirectUrl } and is processed asynchronously as a promise.  Hence I'm experiencing 3 different assertions failures, it's a race.  This bug deals with one of them.

0 HttpObserverManager.applyChanges<() ["resource://gre/modules/WebRequest.jsm":778]
1 next(val = [object Object]) ["self-hosted":1134]
    this = [object Generator]
2 TaskImpl_run(aSendResolved = true, aSendValue = [object Object]) ["resource://gre/modules/Task.jsm":319]
    this = [object Object]
3 bound TaskImpl_run([object Object]) ["self-hosted":971]

	xul.dll!mozilla::net::HttpBaseChannel::RedirectTo
	xul.dll!_NS_InvokeByIndex
Whiteboard: [necko-next]
Turn out to be the same issue/fix.  Difference in the assertion hit is caused by timing of when redirectTo is called between asyncOpen and onStartRequest notification.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Whiteboard: [necko-next]
You need to log in before you can comment on or make changes to this bug.