Closed
Bug 479490
Opened 16 years ago
Closed 16 years ago
###!!! ASSERTION: Mismatched calls to ResumeTimeouts!: 'mTimeoutsSuspendDepth', file //mozilla/dom/src/base/nsGlobalWindow.cpp, line 8436
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla1.9.2a1
People
(Reporter: smaug, Assigned: smaug)
References
Details
(Keywords: assertion, crash, verified1.9.1, Whiteboard: [needed to fix bug 479143])
Attachments
(3 files, 3 obsolete files)
19.22 KB,
patch
|
smaug
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
1.33 KB,
patch
|
Details | Diff | Splinter Review | |
15.92 KB,
patch
|
Details | Diff | Splinter Review |
I get the assertion if using "back for an iframe.
http://mozilla.pettay.fi/xhr_upload/xhr_upload_demo_sync.html
Click the buttons for iframe to add something to shistory, then start (sync)XHR
and press back.
Here's a first stab... What do you guys think? I think it's hideous, but the other places I tried to hook were unreliable.
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #363451 -
Flags: superreview?(jst)
Attachment #363451 -
Flags: review?(jst)
Updated•16 years ago
|
Attachment #363451 -
Flags: review?(Olli.Pettay)
Assignee | ||
Comment 2•16 years ago
|
||
I wonder why you want top, not parent.
What if there are nested iframes and back-forward is used for the most inner one,
does the approach still work?
Assignee | ||
Comment 3•16 years ago
|
||
Hrm, there is also the case when something is loaded from history (not bfcache). It should have its timeouts suspended if it is loaded to a iframe
inside a window which has timeouts suspended.
(Trying to think of something which combines event suppression handling and
timer suspension here...)
Assignee | ||
Comment 4•16 years ago
|
||
FYI, I added a timer test to that test page.
Assignee | ||
Comment 5•16 years ago
|
||
For testing browser.sessionhistory.cache_subframes=true is useful.
Assignee | ||
Updated•16 years ago
|
Attachment #363451 -
Flags: review?(Olli.Pettay) → review-
Assignee | ||
Comment 6•16 years ago
|
||
Comment on attachment 363451 [details] [diff] [review]
Patch, v1
we need to do something else.
Assignee | ||
Comment 7•16 years ago
|
||
Patch coming, I hope.
Assignee | ||
Comment 8•16 years ago
|
||
This patch isn't as bad as it looks like.
nsGlobalWindow::SuspendTimeouts/ResumeTimeouts changes are mainly because
of one extra "if". Sub windows' SuspendTimeouts should be called even if
window is already suspended!
The patch applies over bug 333198, and it does fix the crash you Bent saw.
(nsRefPtr in nsGlobalWindow::SetDocShell)
I tested this with and without browser.sessionhistory.cache_subframes
(Trying to get hg to create a -w patch)
Attachment #363695 -
Flags: superreview?(jst)
Attachment #363695 -
Flags: review?(bent.mozilla)
Updated•16 years ago
|
Attachment #363451 -
Attachment is obsolete: true
Attachment #363451 -
Flags: superreview?(jst)
Attachment #363451 -
Flags: review?(jst)
Updated•16 years ago
|
Attachment #363695 -
Flags: review?(bent.mozilla) → review+
Comment on attachment 363695 [details] [diff] [review]
patch
This patch tests fine for me!
>+ nsresult ResumeTimeoutsNoThaw() { return ResumeTimeouts(PR_FALSE); }
I get why you made this but I think it either doesn't belong on the interface or there should also be a SuspendNoFreeze or something.
>+ virtual PRUint32 TimeoutsSuspended() = 0;
Maybe call this TimeoutSuspendCount? Currently it's not obvious that it returns an int.
>+ for (nsRefPtr<nsGlobalWindow> inner = (nsGlobalWindow *)PR_LIST_HEAD(this);
Nice catch!!!
Updated•16 years ago
|
Assignee: bent.mozilla → Olli.Pettay
Updated•16 years ago
|
Attachment #363695 -
Flags: superreview?(jst) → superreview+
Comment 10•16 years ago
|
||
Comment on attachment 363695 [details] [diff] [review]
patch
- In nsXMLHttpRequest::Send():
resumeTimeoutRunnable = NS_NEW_RUNNABLE_METHOD(nsPIDOMWindow,
suspendedWindow.get(),
- ResumeTimeouts);
+ ResumeTimeoutsNoThaw);
I'd love to see this done w/o having to add this ResumeTimeoutsNoThaw() to the API. I.e. create a new runnable that just calles ResumeTimeouts() with the appropriate arguments, or something. A bit more code, but I think that's a good tradeoff here.
- In nsGlobalWindow::SetNewDocument():
+ nsCOMPtr<nsIDOMWindow> parentWindow;
+ GetParent(getter_AddRefs(parentWindow));
+ nsCOMPtr<nsPIDOMWindow> pWindow = do_QueryInterface(parentWindow);
+ if (pWindow && pWindow->TimeoutsSuspended()) {
+ SuspendTimeouts(pWindow->TimeoutsSuspended());
+ }
This doesn't look right. GetParent() returns |this| if there is no parent (yeah, silly, but that's what it does), and that's probably not what you want here. Use GetParentInternal(), or explicitly check for that case here.
sr=jst with that fixed.
Updated•16 years ago
|
Flags: blocking1.9.1+
Priority: -- → P1
Whiteboard: [needs landing]
Target Milestone: --- → mozilla1.9.1b3
Assignee | ||
Comment 11•16 years ago
|
||
I'll update the patch.
Note, this requires bug 333198.
Depends on: 333198
Assignee | ||
Comment 12•16 years ago
|
||
Attachment #363695 -
Attachment is obsolete: true
Comment 13•16 years ago
|
||
See also bug 480158 -- looks related. (may be fixed by this bug's patch)
Updated patch, interdiff in a sec.
Attachment #363876 -
Attachment is obsolete: true
Attachment #364167 -
Flags: superreview?(jst)
Attachment #364167 -
Flags: review?(Olli.Pettay)
This simply makes sure that we use the top's inner window rather than the outer in case the inner changes during the sync xhr.
Assignee | ||
Updated•16 years ago
|
Attachment #364167 -
Flags: review?(Olli.Pettay) → review+
Updated•16 years ago
|
Whiteboard: [needs landing] → [needs landing][needed to fix bug 479143]
Comment 17•16 years ago
|
||
Comment on attachment 364167 [details] [diff] [review]
patch
sr=jst
Attachment #364167 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 18•16 years ago
|
||
Thanks bent
http://hg.mozilla.org/mozilla-central/rev/fee69bd1bfa7
I'll push this to 1.9.1
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing][needed to fix bug 479143] → [needed to fix bug 479143]
Assignee | ||
Comment 19•16 years ago
|
||
Updated•16 years ago
|
Keywords: fixed1.9.1
Target Milestone: mozilla1.9.1b3 → mozilla1.9.2a1
Assignee | ||
Updated•16 years ago
|
Keywords: fixed1.9.1
Assignee | ||
Comment 20•16 years ago
|
||
Updated•16 years ago
|
Updated•16 years ago
|
Priority: P1 → P2
Assignee | ||
Comment 22•16 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Comment 23•16 years ago
|
||
Keywords: fixed1.9.1
Comment 24•16 years ago
|
||
So the patch was backed-out on trunk and 1.9.1. Means the assertion has been fixed by a patch on another bug?
Assignee | ||
Comment 25•16 years ago
|
||
The patch was backed out and the it relanded.
Comment 26•16 years ago
|
||
verified FIXED on debug builds:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090706 Minefield/3.6a1pre ID:20090706143743
and
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1pre) Gecko/20090706 Shiretoko/3.5.1pre ID:20090706143721
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
Updated•12 years ago
|
Component: DOM: Mozilla Extensions → DOM
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•