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)

x86
macOS
defect

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)

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.
Attached patch Patch, v1 (obsolete) — Splinter Review
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)
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?
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...)
FYI, I added a timer test to that test page.
For testing browser.sessionhistory.cache_subframes=true is useful.
Attachment #363451 - Flags: review?(Olli.Pettay) → review-
Comment on attachment 363451 [details] [diff] [review] Patch, v1 we need to do something else.
Patch coming, I hope.
Attached patch patch (obsolete) — Splinter Review
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)
Attachment #363451 - Attachment is obsolete: true
Attachment #363451 - Flags: superreview?(jst)
Attachment #363451 - Flags: review?(jst)
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!!!
Assignee: bent.mozilla → Olli.Pettay
Attachment #363695 - Flags: superreview?(jst) → superreview+
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.
Flags: blocking1.9.1+
Priority: -- → P1
Whiteboard: [needs landing]
Target Milestone: --- → mozilla1.9.1b3
I'll update the patch. Note, this requires bug 333198.
Depends on: 333198
Attached patch patch (obsolete) — Splinter Review
Attachment #363695 - Attachment is obsolete: true
See also bug 480158 -- looks related. (may be fixed by this bug's patch)
Attached patch patchSplinter Review
Updated patch, interdiff in a sec.
Attachment #363876 - Attachment is obsolete: true
Attachment #364167 - Flags: superreview?(jst)
Attachment #364167 - Flags: review?(Olli.Pettay)
Attached patch interdiffSplinter Review
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.
Attachment #364167 - Flags: review?(Olli.Pettay) → review+
Whiteboard: [needs landing] → [needs landing][needed to fix bug 479143]
Comment on attachment 364167 [details] [diff] [review] patch sr=jst
Attachment #364167 - Flags: superreview?(jst) → superreview+
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]
Keywords: fixed1.9.1
Target Milestone: mozilla1.9.1b3 → mozilla1.9.2a1
Keywords: fixed1.9.1
Backed out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Keywords: assertion, crash
Priority: P1 → P2
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
So the patch was backed-out on trunk and 1.9.1. Means the assertion has been fixed by a patch on another bug?
The patch was backed out and the it relanded.
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
Component: DOM: Mozilla Extensions → DOM
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: