Last Comment Bug 315286 - Crash [@ nsGlobalWindow::RunTimeout ]
: Crash [@ nsGlobalWindow::RunTimeout ]
Status: RESOLVED FIXED
[sg:dos][rft-dl]
: crash, fixed1.8.1, regression, testcase, verified1.8.0.2
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: P1 critical (vote)
: mozilla1.9alpha1
Assigned To: Blake Kaplan (:mrbkap) (please use needinfo!)
: Hixie (not reading bugmail)
Mentors:
https://bugzilla.mozilla.org/attachme...
: 319932 (view as bug list)
Depends on: 489812
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-06 09:43 PST by Bob Clary [:bc:]
Modified: 2009-12-08 11:49 PST (History)
12 users (show)
dveditz: blocking1.9a1+
dveditz: blocking1.8.0.2+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (779 bytes, patch)
2005-12-22 09:55 PST, Ere Maijala (slow)
mrbkap: review-
Details | Diff | Review
Proposed fix (4.05 KB, patch)
2006-01-31 13:53 PST, Blake Kaplan (:mrbkap) (please use needinfo!)
jst: review+
bzbarsky: superreview+
brendan: approval‑branch‑1.8.1+
brendan: approval1.8.0.2+
Details | Diff | Review

Description Bob Clary [:bc:] 2005-11-06 09:43:27 PST
Crash in testcase for bug 37907 in Firefox 1.5/20051105/WinXP, haven't tested trunk yet. Marking sensitive, just in case.

	delay	0x00177408
	nsITimer::TYPE_ONE_SHOT	0x00000000
	rv	0x30025d10
+	this	0x03103278
+	timeout	0x035f1d68
-	timeout->mTimer	{...}
+           mRawPtr	0x00000000


nsGlobalWindow::RunTimeout(nsTimeout * 0x035f1d68) line 6357 + 41 bytes
nsGlobalWindow::TimerCallback(nsITimer * 0x035f1e78, void * 0x035f1d68) line 6656
nsTimerImpl::Fire() line 394 + 17 bytes
nsTimerManager::FireNextIdleTimer(nsTimerManager * const 0x00f96c78) line 628
nsAppShell::Run(nsAppShell * const 0x00f64938) line 142
nsAppStartup::Run(nsAppStartup * const 0x00f64898) line 150 + 26 bytes
XRE_main(int 0x00000002, char * * 0x003f6ea0, const nsXREAppData * 0x0042201c kAppData) line 2313 + 35 bytes
main(int 0x00000002, char * * 0x003f6ea0) line 61 + 18 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 7c816d4f()
Comment 1 Bob Clary [:bc:] 2005-11-06 09:50:58 PST
###!!! ASSERTION: You can't dereference a NULL nsCOMPtr with operator->().: 'mRawPtr != 0', file ../../dist/include/xpcom\nsCOMPtr.h
, line 849
Comment 2 Peter van der Woude [:Peter6] 2005-12-02 11:25:41 PST
Incident ID: 12503895
Stack Signature	nsGlobalWindow::RunTimeout 02670766
Product ID	Firefox15
Build ID	2005120103
Trigger Time	2005-12-02 02:43:53.0
Platform	Win32
Operating System	Windows NT 5.0 build 2195
Module	firefox.exe + (00151112)
URL visited	http://112brabant.isookleuk.nl/nieuws/chat/index_main.php?width=1280&height=1024
User Comments	
Since Last Crash	25811 sec
Total Uptime	25811 sec
Trigger Reason	Access violation
Source File, Line No.	c:/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/dom/src/base/nsGlobalWindow.cpp, line 6357
Stack Trace 	
nsGlobalWindow::RunTimeout  [c:/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/dom/src/base/nsGlobalWindow.cpp, line 6357]
nsGlobalWindow::TimerCallback  [c:/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/dom/src/base/nsGlobalWindow.cpp, line 6656]
nsAppStartup::Run  [c:/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/toolkit/components/startup/src/nsAppStartup.cpp, line 151]
main  [c:/builds/tinderbox/Fx-Mozilla1.8/WINNT_5.2_Depend/mozilla/browser/app/nsBrowserApp.cpp, line 61]
KERNEL32.dll + 0x28989 (0x7c598989)
Comment 3 Ryan Flint [:rflint] (ping via IRC for reviews) 2005-12-11 21:40:46 PST
*** Bug 319932 has been marked as a duplicate of this bug. ***
Comment 4 Adam Guthrie 2005-12-21 12:16:57 PST
*** Bug 320982 has been marked as a duplicate of this bug. ***
Comment 5 Ere Maijala (slow) 2005-12-22 09:55:48 PST
Created attachment 206617 [details] [diff] [review]
Patch v1

Null check patch. This is kind of out of my domain but now that I stumbled on this I found out that timeout->mTimer can be null even though timeout->mInterval != 0.
Comment 6 Johnny Stenback (:jst, jst@mozilla.com) 2005-12-28 12:20:47 PST
(In reply to comment #5)
> Created an attachment (id=206617) [edit]
> Patch v1
> 
> Null check patch. This is kind of out of my domain but now that I stumbled on
> this I found out that timeout->mTimer can be null even though
> timeout->mInterval != 0.
> 

Do you know why this can happen? I haven't digged through the code to find out why yet, just wondering if you already did...
Comment 7 Ere Maijala (slow) 2005-12-28 14:37:47 PST
SuspendTimeouts perhaps. At least it's called right there when it would crash and it will delete mTimer without touching mInterval.
Comment 8 Bob Clary [:bc:] 2006-01-20 00:14:41 PST
also crashes on Mac OS X, at least with FF 1.5.0.1 RC1
Comment 9 Blake Kaplan (:mrbkap) (please use needinfo!) 2006-01-30 21:25:52 PST
Comment on attachment 206617 [details] [diff] [review]
Patch v1

This is close, but it won't reset the timer to start again (I'll explain when I attach my patch, which isn't quite complete yet)
Comment 10 Blake Kaplan (:mrbkap) (please use needinfo!) 2006-01-30 21:28:01 PST
What's happening here is that RunTimeout doesn't deal with the case where we call SuspendTimeouts while dealing with a timeout that's currently running. The patch is going to be somewhat messy because of bad factorizing in the timeout code.
Comment 11 Blake Kaplan (:mrbkap) (please use needinfo!) 2006-01-31 13:53:36 PST
Created attachment 210270 [details] [diff] [review]
Proposed fix

Note that this is a diff -w. I'll attach a full diff once I have reviews ;-). I think this leaves the timeout list in a sane state if we end up being frozen from executing one of the timers.

Note that setting up the timers correctly in this case is extra work, but this bug would also occur if the timeout had just set location.href (and really put the page into the bfcache).
Comment 12 Johnny Stenback (:jst, jst@mozilla.com) 2006-01-31 15:31:32 PST
Comment on attachment 210270 [details] [diff] [review]
Proposed fix

Looks good. r=jst
Comment 13 Blake Kaplan (:mrbkap) (please use needinfo!) 2006-02-03 12:00:55 PST
Fix checked into trunk.
Comment 14 Jesse Ruderman 2006-02-05 18:08:26 PST
There was a topcrash in Firefox 1.5.0.1 (but not on trunk) with the same signature.  Would this patch fix it if applied to the branch?
Comment 15 Blake Kaplan (:mrbkap) (please use needinfo!) 2006-02-06 15:30:04 PST
(In reply to comment #14)
> There was a topcrash in Firefox 1.5.0.1 (but not on trunk) with the same
> signature.  Would this patch fix it if applied to the branch?

It's very possible that it would.
Comment 16 Daniel Veditz [:dveditz] 2006-02-09 15:15:11 PST
Tenatively making blocking, pending trunk testing to make sure there aren't regressions.
Comment 17 Brendan Eich [:brendan] 2006-02-22 15:21:31 PST
Comment on attachment 210270 [details] [diff] [review]
Proposed fix

Approving, dveditz let me know if you think I've done wrong here -- mrbkap was trying to avoid entangling with jst via CVS, and this patch seems baked, safe, and wanted.

/be
Comment 18 Blake Kaplan (:mrbkap) (please use needinfo!) 2006-02-22 15:34:02 PST
Fix checked into the 1.8 branches.
Comment 19 Dave Liebreich [:davel] 2006-03-02 10:44:52 PST
Marking [rft-dl] (ready for testing in Firefox 1.5.0.2 release candidates)
Comment 20 Jay Patel [:jay] 2006-03-02 15:42:31 PST
v.fixed on 1.8.0 branch with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060302 Firefox/1.5.0.1, no crash with testcase from bug 37907 (https://bugzilla.mozilla.org/attachment.cgi?id=8207).
Comment 21 1106-29 2006-04-22 22:38:30 PDT
i tested rv:1.8.0.2 Gecko/20060308 Firefox/1.5.0.2
browser crash. See Bug 320982 and use URL for testing.
 

Note You need to log in before you can comment on or make changes to this bug.