Closed Bug 109567 Opened 23 years ago Closed 23 years ago

Crash doing print preview

Categories

(Core :: Printing: Output, defect)

x86
Linux
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla0.9.7

People

(Reporter: bzbarsky, Assigned: rods)

References

()

Details

(Keywords: crash)

Attachments

(2 files)

BUILD: Linux trunk 2001-11-09-08 STEPS TO REPRODUCE: 1) Load http://www.tvguide.com/Listings/index.asp 2) File > Print Preview 3) Scroll all the way down 4) Drag another window on top of the print preview one. Drag it off 5) Crash (gdb) frame 0 #0 0x4116585d in nsEventStateManager::PreHandleEvent (this=0x858e110, aPresContext=0x825fd40, aEvent=0xbfffe900, aTargetFrame=0x86295b0, aStatus=0xbfffe830, aView=0x82f7ac0) at nsEventStateManager.cpp:614 614 shell->GetPresContext(getter_AddRefs(context)); (gdb) p shell $1 = {mRawPtr = 0x0} #0 0x4116585d in nsEventStateManager::PreHandleEvent (this=0x858e110, aPresContext=0x825fd40, aEvent=0xbfffe900, aTargetFrame=0x86295b0, aStatus=0xbfffe830, aView=0x82f7ac0) at nsEventStateManager.cpp:614 #1 0x41dc607c in PresShell::HandleEventInternal (this=0x840b338, aEvent=0xbfffe900, aView=0x82f7ac0, aFlags=1, aStatus=0xbfffe830) at nsPresShell.cpp:5809 #2 0x41dc5c93 in PresShell::HandleEvent (this=0x840b338, aView=0x82f7ac0, aEvent=0xbfffe900, aEventStatus=0xbfffe830, aForceHandle=1, aHandled=@0xbfffe7e4) at nsPresShell.cpp:5740 #3 0x420b3935 in nsView::HandleEvent (this=0x82f7ac0, event=0xbfffe900, aEventFlags=28, aStatus=0xbfffe830, aForceHandle=1, aHandled=@0xbfffe7e4) at nsView.cpp:362 #4 0x420bf6af in nsViewManager::DispatchEvent (this=0x82f7940, aEvent=0xbfffe900, aStatus=0xbfffe830) at nsViewManager.cpp:1872 #5 0x420b2f5e in HandleEvent (aEvent=0xbfffe900) at nsView.cpp:81 #6 0x40bb2a18 in nsWidget::DispatchEvent (this=0x8246e48, aEvent=0xbfffe900, aStatus=@0xbfffe8c8) at nsWidget.cpp:1408 #7 0x40bb265c in nsWidget::DispatchWindowEvent (this=0x8246e48, event=0xbfffe900) at nsWidget.cpp:1299 #8 0x40bb2704 in nsWidget::DispatchFocus (this=0x8246e48, aEvent=@0xbfffe900) at nsWidget.cpp:1321 #9 0x40bb9685 in nsWindow::DispatchActivateEvent (this=0x8246e48) at nsWindow.cpp:1383 #10 0x40bb94c9 in nsWindow::SetFocus (this=0x8246e48, aRaise=1) at nsWindow.cpp:1289
Attached file Complete stack trace
So... why does this document not have a presshell at index 0? Seems like we should null-check the shell here if nothing else...
Blocks: 103890
BZ: is this bug related to bug 78422 ? (If I compare the stack)
No, this crashes at a different point in the same general area...
Keywords: crash
Althoug there is an assumption that nsIDocuments must/should always have a PresShell, for PP they do not. So a check definitely needs to go in. BUT the better question is, why is it being ask to be focused? We are filtering out all those events.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.7
I have only been able to reproduce it once. SO I'll put a check in and maybe an assert so I can catch it later.
Attached patch PatchSplinter Review
Focus events should not be getting thru when the shell for a doc is null, documents do not have a shell set when doing print preview.
r=dcone
Comment on attachment 57773 [details] [diff] [review] Patch sr=attinasi - good assertion and protection.
Attachment #57773 - Flags: superreview+
fixed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Boris, please verify when you get a chance on latest build...thanks..
Fixed for me in this morning's build. can't reproduce after much clicking and dragging and the like (had no such problems with reproduction in yesterday's build).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: