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]
Created attachment 249668 [details] [diff] [review] Patch rev. 1 This patch adds the same test in ::PrintPreview as is already present in ::Print http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/base/nsDocumentViewer.cpp&rev=1.505&root=/cvsroot&mark=3464-3471#3432
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
Created attachment 249693 [details] [diff] [review] Patch rev. 2 Added some more error checking. The first two hunks are unrelated - they fix two compile warnings.
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+
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
Last Resolved: 12 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.