Closed Bug 530880 Opened 11 years ago Closed 11 years ago

Crashes [@ nsIFrame::GetStyleDisplay() ]


(Core :: Layout, defect)

Windows XP
Not set



Tracking Status
status1.9.2 --- beta5-fixed
blocking1.9.1 --- .8+
status1.9.1 --- .8-fixed


(Reporter: chofmann, Assigned: smaug)


(Blocks 1 open bug)


(Keywords: fixed1.9.0.18, Whiteboard: [sg:critical?])


(2 files, 3 obsolete files)

new crash on trunk and firefox 3.6 due to frame poisoning

spin off from bug 526587

#12 rank in report from 2009 11 22
12. 92 0xfffffffff0dea817 Windows NT nsIFrame::GetStyleDisplay()

reports at

rame  	Module  	Signature [Expand]  	Source
0 	xul.dll 	nsIFrame::GetStyleDisplay 	layout/style/nsStyleStructList.h:95
1 	xul.dll 	xul.dll@0x41cb0b 	
2 	xul.dll 	PresShell::HandleEventInternal 	layout/base/nsPresShell.cpp:6471
3 	xul.dll 	PresShell::HandlePositionedEvent 	layout/base/nsPresShell.cpp:6296
4 	xul.dll 	PresShell::HandleEvent 	layout/base/nsPresShell.cpp:6160
5 	xul.dll 	nsViewManager::HandleEvent 	view/src/nsViewManager.cpp:1222
6 	xul.dll 	nsViewManager::DispatchEvent 	view/src/nsViewManager.cpp:1201
7 	xul.dll 	HandleEvent 	view/src/nsView.cpp:167
8 	xul.dll 	nsWindow::DispatchEvent 	widget/src/windows/nsWindow.cpp:2885
9 	xul.dll 	nsWindow::DispatchWindowEvent 	widget/src/windows/nsWindow.cpp:2913
10 	xul.dll 	nsWindow::DispatchMouseEvent 	widget/src/windows/nsWindow.cpp:3288
11 	xul.dll 	ChildWindow::DispatchMouseEvent 	widget/src/windows/nsWindow.cpp:6959

sort on address for more reports
not much to go on from user comments to produce STR, but if code inspection can turn up a quick fix it would be good to take that fix in 3.6b/rc/final
Flags: blocking1.9.2?
So I'm not quite sure yet, but perhaps this has something to do with
PresShell::NotifyDestroyingFrame and PresShell::ClearFrameRefs.
The first one is called always but the latter one only when 

Bug 67752 (ireflow) added mFramesToDirty.RemoveEntry(aFrame) to ClearFrameRefs,
but I'm not yet sure whether it adds the right bits to frames.

We could probably merge NotifyDestroyingFrame and ClearFrameRefs, and use the
frame bits to just optimize weakframe destroy handling.
Attached patch wip (obsolete) — Splinter Review
Oops that patch contains some unrelated htmlinput things
Attached patch wip (obsolete) — Splinter Review
Attachment #414338 - Attachment is obsolete: true
Attached patch wipSplinter Review
Perhaps it is even safer to clear mFramesToDirty
Assignee: nobody → Olli.Pettay
Attachment #414339 - Attachment is obsolete: true
My analysis of mCurrentEventFrame handling is probably a bit wrong.
In practice ESM will have an nsWeakFrame pointing to mCurrentEventFrame, so
ClearFrameRefs will be called.

mFramesToDirty handling is something to fix.
And maybe mCurrentEventFrameStack handling too.

But still, I'm not at all sure the patch would fix this bug :/

Jst, could I get a minidump for this.
Maybe I could get something out of xul.dll@0x41cb0b
Doh.  Good catch on mFramesToDirty!
Comment on attachment 414343 [details] [diff] [review]

Ok, as far as I see, we need this.

There are cases when mCurrentEventFrame is set, but without the flags, which would cause ClearFrameRefs to be called. (Those flags are set for example when ESM takes the reference.)

One such case is calling first PresShell::HandleDOMEventWithTarget then call PresShell::GetCurrentEventFrame().

One of the minidumps does show a case where PresShell::HandleDOMEventWithTarget is called, and then the event listener does something which spins the event loop and new  event patch is dispatched and bad things happen.

I'm still not 100% the patch will fix this crash.

And frame must be removed from mFramesToDirty. 

I could file a followup to merge ClearFrameRefs and NotifyDestroyingFrame on trunk.
Attachment #414343 - Flags: superreview?(roc)
Attachment #414343 - Flags: review?(bzbarsky)
And note, mCurrentEventFrameStack.Length() is usually 0 when destroying frames.
Attachment #414343 - Flags: review?(bzbarsky) → review+
Comment on attachment 414343 [details] [diff] [review]

I assume mFramesToDirty will also be usually empty, since we only use it during the unwind for an interrupt?
Attachment #414343 - Flags: superreview?(roc) → superreview+
Ah, but it's a hashtable so that lookup is O(1) anyway.
Comment on attachment 414343 [details] [diff] [review]

This is not blocking 1.9.2, so can't land even to trunk.
Attachment #414343 - Flags: approval1.9.2?
Flags: blocking1.9.2? → blocking1.9.2-
Attachment #414343 - Flags: approval1.9.2? → approval1.9.2+

Will push to 1.9.2 once trunk tests have run.
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Blocks: 531175
I think we want this to 1.9.1.x
blocking1.9.1: --- → ?
Is this needed on the 1.9.0 branch as well?
blocking1.9.1: ? → .7+
Flags: wanted1.9.0.x?
Flags: blocking1.9.0.17?
Whiteboard: [need answer to comment 18 from smaug]
I believe yes, we need this on 1.9.0 too.
Attached patch 1.9.0/1 (obsolete) — Splinter Review
This applies to 1.9.0.x and 1.9.1.x. The main difference to original patch is that
1.9.2/trunk have mFramesToDirty.RemoveEntry(aFrame) line, which doesn't exists on older branches.
Attachment #418666 - Flags: approval1.9.1.8?
Attachment #418666 - Flags: approval1.9.0.18?
Flags: wanted1.9.0.x?
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.18?
Flags: blocking1.9.0.18+
Whiteboard: [need answer to comment 18 from smaug]
Comment on attachment 418666 [details] [diff] [review]

Approved for and, a=dveditz for release-drivers
Attachment #418666 - Flags: approval1.9.1.8?
Attachment #418666 - Flags: approval1.9.1.8+
Attachment #418666 - Flags: approval1.9.0.18?
Attachment #418666 - Flags: approval1.9.0.18+
Whiteboard: [needs 1.9.1/1.9.0 landing]
Attached patch for 1.9.0/1Splinter Review
Uh, somehow I had uploaded a wrong patch for branches.
This one doesn't have any 1.9.2/trunk stuff.
Attachment #418666 - Attachment is obsolete: true
This crash is not fixed on 1.9.2. There are still a dozen of crashes with the identical stack:

Crashes on 1.9.0 have a different stack. I wasn't able to find a bug which covers those crashes. Shall I file a new one? I believe those are different:


And all those crashes are Windows only, not OS X.
OS: Mac OS X → Windows XP
Target Milestone: --- → mozilla1.9.3a1
Henrik, could you open a new bug.
The crash has dropped from #12 to somewhere significantly lower, I assume.
So a crash causing the stack trace seems to be fixed, but perhaps there is still
something else.
For Firefox 3.6 we have bug 542833 now. I don't think it's worth filing a bug for 3.0.x yet, there are only 5 crashes for 3.0.17.
How did crashes go down when this wasn't fixed in, Henrik?
(In reply to comment #27)
> How did crashes go down when this wasn't fixed in, Henrik?

See comment 24. Crashes on 1.9.0 which I have mentioned have another stack. So those are not related to this particular bug.
Whiteboard: [sg:critical?]
I assume that there is no particular way to induce this bug on 1.9.1 or 1.9.0 for the purposes of verification (especially with comment 24 and 27)?
Al, we should wait for the release and check crashstats later. If the number drops drastically on both branches we are good.
Group: core-security
You need to log in before you can comment on or make changes to this bug.