Closed Bug 428013 Opened 16 years ago Closed 16 years ago

crash [@ nsPrintEngine::DocumentReadyForPrinting() ] when page is drag&drop to Print Preview window after printing

Categories

(Core :: Print Preview, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: aha, Assigned: martijn.martijn)

References

(Depends on 1 open bug)

Details

(Keywords: crash, verified1.9.1)

Crash Data

Attachments

(3 files, 1 obsolete file)

Repro:
1. open a web page
2. open Print Preview
3. print something to a printer
4. drag&drop HTML file to Print Preview window

-> crash

http://crash-stats.mozilla.com/report/index/005608e8-064a-11dd-8867-001cc45a2ce4
http://crash-stats.mozilla.com/report/index/c0c61985-0649-11dd-aea0-001321b13766

Signature	nsPrintEngine::DocumentReadyForPrinting()
Product		Firefox
Version		3.0pre
Build ID	2008040805
OS		Windows NT
OS Version	5.1.2600 Service Pack 2
CPU		x86
CPU Info	GenuineIntel family 6 model 14 stepping 8
Crash Reason	EXCEPTION_ACCESS_VIOLATION
Crash Address	0x30

Stacktrace:
nsPrintEngine::DocumentReadyForPrinting()
	 mozilla/layout/printing/nsPrintEngine.cpp:1466
xul.dll@0x2be260
DocumentViewerImpl::Show()
	mozilla/layout/base/nsDocumentViewer.cpp:1844
nsPresContext::EnsureVisible(int)
	mozilla/layout/base/nsPresContext.cpp:1460
PresShell::UnsuppressAndInvalidate()
	mozilla/layout/base/nsPresShell.cpp:4327
PresShell::UnsuppressPainting()
	mozilla/layout/base/nsPresShell.cpp:4387
DocumentViewerImpl::LoadComplete(unsigned int)
	mozilla/layout/base/nsDocumentViewer.cpp:1013
nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, unsigned int)
	mozilla/docshell/base/nsDocShell.cpp:5061
nsWebShell::EndPageLoad(nsIWebProgress*, nsIChannel*, unsigned int)
	mozilla/docshell/base/nsWebShell.cpp:1013
nsCOMPtr_base::assign_from_qi(nsQueryInterface, nsID const&)
	nsCOMPtr.cpp:96
nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, unsigned int)
	mozilla/docshell/base/nsDocShell.cpp:4966 

Bug 416920 has same signature, but different stacktrace.
Bug 444843 is related to this.
Blocks: 444843
Attached patch patch (obsolete) — Splinter Review
This seems to fix it and the other bug I mentioned.
Attachment #339265 - Flags: review?(sharparrow1)
Attached file testcase
Making a mochitest that test this kind of bug turns out to be quite hairy.
Attachment #339265 - Flags: review?(sharparrow1) → review+
Comment on attachment 339265 [details] [diff] [review]
patch

This is okay, but please put a fat comment explaining that calling SetIsPrinting while in print preview confuses the document viewer, and that this is safe because we prevent exiting print preview while printing.
Attached patch mochitestSplinter Review
Thanks for the review, Eli. Perhaps you also have some tips on how to make the mochitest better. Especially the timers are bad. I've made them so big, because otherwise they might fail in my debug build (which is really slow). Ideally, I would use a more reliable method of executing, instead of using timers, but I have no idea how.
Eli, see my attempt at making a mochitest for this and comment 5. Btw, this mochitest will leak too, which is bug 408355.
Assignee: nobody → martijn.martijn
(In reply to comment #6)
> Eli, see my attempt at making a mochitest for this and comment 5. Btw, this
> mochitest will leak too, which is bug 408355.

Sorry, I don't have any suggestions there... the current printing code is rather unpleasant :(.
Comment on attachment 339265 [details] [diff] [review]
patch

Ok, well, I'm not sure the mochitest should be checked in in this state, it just seems to fragile.
Attachment #339265 - Flags: superreview?(roc)
Attachment #339265 - Attachment is obsolete: true
Attachment #339352 - Flags: superreview?(roc)
Attachment #339352 - Flags: review+
Attachment #339265 - Flags: superreview?(roc)
Attachment #339352 - Flags: superreview?(roc) → superreview+
Perhaps, it still would be wise to check in the mochitest? If it would cause trouble, then it could be disabled. But perhaps the timers make it too slow a test anyway?
Keywords: checkin-needed
Checked in:
$ hg tip
changeset:   24061:ade1e110f6fb
tag:         tip
user:        Martijn Wargers <mwargers@mozilla.com>
date:        Thu Jan 22 16:36:25 2009 +0100
summary:     Bug 428013 - crash [@ nsPrintEngine::DocumentReadyForPrinting() ] w
hen page is drag&drop to Print Preview window after printing, r=sharparrow1, sr=
roc

It might be easier to get a suitable mochitest for this, if bug 422949 is fixed.
Status: NEW → RESOLVED
Closed: 16 years ago
Depends on: 422949
Flags: in-testsuite?
Resolution: --- → FIXED
Attachment #339352 - Flags: approval1.9.1?
Keywords: checkin-needed
Comment on attachment 339352 [details] [diff] [review]
patch, with Eli's comment in it

a191=beltzner
Attachment #339352 - Flags: approval1.9.1? → approval1.9.1+
Verified fixed on the 1.9.1 branch using : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b5pre) Gecko/20090520 Shiretoko/3.5b5pre. I don't see the crash following the STR in Comment 0. Adding keyword.
Crash Signature: [@ nsPrintEngine::DocumentReadyForPrinting() ]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: