Closed
Bug 299553
Opened 19 years ago
Closed 19 years ago
[FIXr]ASSERTION: Overwriting an existing document channel!
Categories
(Core :: Networking, defect, P2)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.8beta4
People
(Reporter: bc, Assigned: bzbarsky)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
Attachments
(1 file)
1.16 KB,
patch
|
Biesinger
:
review+
darin.moz
:
superreview+
benjamin
:
approval1.8b4+
|
Details | Diff | Splinter Review |
The test "randomly" loads one of two different documents into an iframe which is document.written into the page. It tests if the correct document has been loaded and alerts if it finds the wrong document otherwise it reloads. In an opt build you may see the alert after a few loads, but if not click refresh. In a debug build the alert will appear quickly and the following assert will appear ###!!! ASSERTION: Overwriting an existing document channel!: '(loadFlags & nsIChannel::LOAD_REPLACE) || !(mDocumentRequest.get())', file c:/work/mozilla/builds/ff/trunk/mozilla/uriloader/base/nsDocLoader.cpp, line 486 This is not a regression, it goes back to at least Mozilla 1.5. MSIE will run the test with no alert until you click refresh. I was trying to write a testcase for bug 295813 which has similar behavior, but in that case the ASSERTION never appeared.
Assignee | ||
Comment 1•19 years ago
|
||
OK, so there are two things going on here: 1) The assertion. This is happening because the docloader has become empty but hasn't figured that out yet. As a result, when we do the reload() there is nothing to stop, so we don't clear the mDocumentRequest, but clobber the existing one with a new one. This is all happening in the _parent_ docshell. The fix here, imo, is to call DocLoaderIsEmpty() in nsDocLoader::Stop() after we've stopped the kids and canceled the loadgroup. I'll attach that. 2) Subframe loads. Per our history design, when we reload the toplevel page we reload the _current_ uri in the subframe, not whatever URI was loaded there initially (the src value of the subframe). In other words, we should get an alert on that testcase as soon as the value of the src attribute changes from what it was when the page was initially loaded. IE has a different behavior -- it will reload the current URI unless the initial URI has changed; in that case it will load the new initial URI. I suppose we could try to duplicate IE's behavior (by storing the "src" attribute of the iframe in the session history entry), but to me it seems like a very counterintuitive behavior and can lead to dataloss for users (reload suddenly loading some totally different page from the one they were looking at).
OS: Windows XP → All
Hardware: PC → All
Assignee | ||
Comment 2•19 years ago
|
||
Attachment #188632 -
Flags: superreview?(darin)
Attachment #188632 -
Flags: review?(cbiesinger)
Comment 3•19 years ago
|
||
Comment on attachment 188632 [details] [diff] [review] Proposed patch maybe you should only call DocLoaderIsEmpty if the mLoadGroup->GetActiveCount(&count) returns 0. granted that is going to be the case because of the way Cancel is implemented on the loadgroup, but that behavior is not well documented. hrm... so, DocLoaderIsEmpty will be called for us in the case where the loadgroup was not empty. should we check to see if the loadgroup is empty before canceling it? then we could know that DocLoaderIsEmpty will not be called and only call it if necessary. maybe?
Comment 4•19 years ago
|
||
I should add that I worry about what might happen during those OnStopRequest calls made by the loadgroup. If we unconditionally call DocLoaderIsEmpty after calling LoadGroup->Cancel, might we inadvertantly affect some other document request (assuming something new was loaded from OnStateChange(STATE_STOP))?
Assignee | ||
Comment 5•19 years ago
|
||
DocLoaderIsEmpty is idempotent if nothing has happened. Also, it does nothing if there are any active loads in the loadgroup or any subframe's loadgroup, and it does nothing if we're not currently in the middle of a load (as determined by mIsLoadingDocument). So I think just calling it unconditionally here is quite safe. The method would perhaps be more accurately named "DocLoaderCouldBeEmpty"...
Comment 6•19 years ago
|
||
Comment on attachment 188632 [details] [diff] [review] Proposed patch ok, then perhaps we should rename this method? ;-)
Attachment #188632 -
Flags: superreview?(darin) → superreview+
Updated•19 years ago
|
Attachment #188632 -
Flags: review?(cbiesinger) → review+
Comment 7•19 years ago
|
||
maybe you should add a comment to nsDocLoader.h stating that DocLoaderIsEmpty is idempotent
Assignee | ||
Comment 8•19 years ago
|
||
Comment on attachment 188632 [details] [diff] [review] Proposed patch requesting 1.8b4 approval for this assertion fix. This is quite low-risk.
Attachment #188632 -
Flags: approval1.8b4?
Assignee | ||
Updated•19 years ago
|
Assignee: darin → bzbarsky
Priority: -- → P2
Summary: ASSERTION: Overwriting an existing document channel! → [FIXr]ASSERTION: Overwriting an existing document channel!
Target Milestone: --- → mozilla1.8beta4
Updated•19 years ago
|
Attachment #188632 -
Flags: approval1.8b4? → approval1.8b4+
Assignee | ||
Comment 9•19 years ago
|
||
Fixed
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•