Closed Bug 365004 Opened 18 years ago Closed 18 years ago

Crash [@ nsPrintEngine::PrintPreview] when trying to print preview a display:none iframe

Categories

(Core :: Printing: Output, defect)

x86
All
defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: martijn.martijn, Assigned: MatsPalmgren_bugz)

Details

(Keywords: crash, testcase)

Crash Data

Attachments

(2 files, 1 obsolete file)

See upcoming testcase, which crashes Mozilla within 1 second. Because of the use of enhanced privileges, you need to download the testcase to your computer. This also crashes Mozilla1.7.12, so no (recent) regression. Talkback ID: TB27739504H nsPrintEngine::PrintPreview [mozilla\layout\printing\nsprintengine.cpp, line 783] DocumentViewerImpl::PrintPreview [mozilla\layout\base\nsdocumentviewer.cpp, line 3557] NS_InvokeByIndex [mozilla\xpcom\reflect\xptcall\src\md\win32\xptcinvoke.cpp, line 102] XPCWrappedNative::CallMethod [mozilla\js\src\xpconnect\src\xpcwrappednative.cpp, line 2162]
Attached file testcase
Attached patch Patch rev. 1 (obsolete) — Splinter Review
Attachment #249668 - Flags: review?(sharparrow1)
Comment on attachment 249668 [details] [diff] [review] Patch rev. 1 Not the right fix; what we should be doing is checking the return value of the print engine Initialize call, which is failing because a null device context and parent widget are provided.
Attachment #249668 - Flags: review?(sharparrow1) → review-
Hmm, the convention elsewhere in the code base seems to be that the caller is responsible for not making calls with invalid arguments, and that the callee asserts this. But you're right that we should also check the return value from Initialize of course.
OS: Windows XP → All
Attached patch Patch rev. 2Splinter Review
Added some more error checking. The first two hunks are unrelated - they fix two compile warnings.
Attachment #249668 - Attachment is obsolete: true
Attachment #249693 - Flags: review?(sharparrow1)
Comment on attachment 249693 [details] [diff] [review] Patch rev. 2 I'd say OOM rather than FAILEDNEW, although it doesn't matter very much.
Attachment #249693 - Flags: review?(sharparrow1) → review+
Assignee: printing → mats.palmgren
Attachment #249693 - Flags: superreview?(roc)
Attachment #249693 - Flags: superreview?(roc) → superreview+
Ok, I changed FAILEDNEW to OOM. Checked in to trunk at 2006-12-31 00:13 PST -> FIXED
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Verified fixed, using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20070103 Minefield/3.0a2pre I now get this error in the error console: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebBrowserPrint.printPreview]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Documents%20and%20Settings/mw/Bureaublad/365004_nsPrintEnginePrintPreview.htm :: printpreview :: line 30" data: no]
Status: RESOLVED → VERIFIED
Crash Signature: [@ nsPrintEngine::PrintPreview]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: