Closed Bug 155189 Opened 22 years ago Closed 22 years ago

Cannot print mail with attachments (all hell breaks loose) [@ nsPrintingPromptService::OnStateChange | DocumentViewerImpl::DonePrintingPages]

Categories

(Core :: Printing: Output, defect)

x86
Windows 2000
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: greer, Assigned: rods)

References

Details

(Keywords: crash, topcrash+, Whiteboard: [ADT2 rtm])

Crash Data

Attachments

(1 file, 1 obsolete file)

Several in internal users have crashed at this signature (yulian, gchan, trix) and I am not finding a bug on it. All of the crashes happened on the 6-27 branch. Is this one already fixed? nsPrintingPromptService::OnStateChange [d:\builds\seamonkey\mozilla\embedding\components\printingui\src\win\nsPrintingPromptService.cpp line 336] PrintData::DoOnProgressChange [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 986] PrintData::OnEndPrinting [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 972] PrintData::~PrintData [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 916] DocumentViewerImpl::DonePrintingPages [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 2715] nsPagePrintTimer::Notify [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 780] nsTimerImpl::Fire [d:\builds\seamonkey\mozilla\xpcom\threads\nsTimerImpl.cpp line 357] nsTimerManager::FireNextIdleTimer [d:\builds\seamonkey\mozilla\xpcom\threads\nsTimerImpl.cpp line 593] nsAppShell::GetNativeEvent [d:\builds\seamonkey\mozilla\widget\src\windows\nsAppShell.cpp line 190] nsXULWindow::ShowModal [d:\builds\seamonkey\mozilla\xpfe\appshell\src\nsXULWindow.cpp line 279] nsWebShellWindow::ShowModal [d:\builds\seamonkey\mozilla\xpfe\appshell\src\nsWebShellWindow.cpp line 1089] nsContentTreeOwner::ShowAsModal [d:\builds\seamonkey\mozilla\xpfe\appshell\src\nsContentTreeOwner.cpp line 450] nsWindowWatcher::OpenWindowJS [d:\builds\seamonkey\mozilla\embedding\components\windowwatcher\src\nsWindowWatcher.cpp line 709] nsWindowWatcher::OpenWindow [d:\builds\seamonkey\mozilla\embedding\components\windowwatcher\src\nsWindowWatcher.cpp line 456] nsPromptService::DoDialog [d:\builds\seamonkey\mozilla\embedding\components\windowwatcher\src\nsPromptService.cpp line 631] nsPromptService::Alert [d:\builds\seamonkey\mozilla\embedding\components\windowwatcher\src\nsPromptService.cpp line 139] nsPrompt::Alert [d:\builds\seamonkey\mozilla\embedding\components\windowwatcher\src\nsPrompt.cpp line 125] DocumentViewerImpl::ShowPrintErrorDialog [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 6898] DocumentViewerImpl::Print [d:\builds\seamonkey\mozilla\content\base\src\nsDocumentViewer.cpp line 6415] nsMsgPrintEngine::OnStateChange [d:\builds\seamonkey\mozilla\mailnews\base\src\nsMsgPrintEngine.cpp line 155] nsDocLoaderImpl::FireOnStateChange [d:\builds\seamonkey\mozilla\uriloader\base\nsDocLoader.cpp line 1175] nsDocLoaderImpl::FireOnStateChange [d:\builds\seamonkey\mozilla\uriloader\base\nsDocLoader.cpp line 1200] nsDocLoaderImpl::doStopDocumentLoad [d:\builds\seamonkey\mozilla\uriloader\base\nsDocLoader.cpp line 834] nsDocLoaderImpl::DocLoaderIsEmpty [d:\builds\seamonkey\mozilla\uriloader\base\nsDocLoader.cpp line 732] nsDocLoaderImpl::OnStopRequest [d:\builds\seamonkey\mozilla\uriloader\base\nsDocLoader.cpp line 663] nsLoadGroup::RemoveRequest [d:\builds\seamonkey\mozilla\netwerk\base\src\nsLoadGroup.cpp line 531] PresShell::RemoveDummyLayoutRequest [d:\builds\seamonkey\mozilla\layout\html\base\src\nsPresShell.cpp line 6780] PresShell::ProcessReflowCommands [d:\builds\seamonkey\mozilla\layout\html\base\src\nsPresShell.cpp line 6587] ReflowEvent::HandleEvent [d:\builds\seamonkey\mozilla\layout\html\base\src\nsPresShell.cpp line 6387] PL_HandleEvent [d:\builds\seamonkey\mozilla\xpcom\threads\plevent.c line 597] PL_ProcessPendingEvents [d:\builds\seamonkey\mozilla\xpcom\threads\plevent.c line 530] _md_EventReceiverProc [d:\builds\seamonkey\mozilla\xpcom\threads\plevent.c line 1078] nsAppShellService::Run [d:\builds\seamonkey\mozilla\xpfe\appshell\src\nsAppShellService.cpp line 458] main1 [d:\builds\seamonkey\mozilla\xpfe\bootstrap\nsAppRunner.cpp line 1473] main [d:\builds\seamonkey\mozilla\xpfe\bootstrap\nsAppRunner.cpp line 1809] WinMain [d:\builds\seamonkey\mozilla\xpfe\bootstrap\nsAppRunner.cpp line 1827] WinMainCRTStartup() KERNEL32.DLL + 0xd326 (0x77e8d326) Source File : http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/embedding/components/printingui/src/win/nsPrintingPromptService.cpp line : 336 (7791199) Comments: Trying to print a mail message with CNN.com as an attachment. (7791038) Comments: Printing msg attached with www.aol.com (7790958) Comments: printing msg attached with cnn.com (7790353) Comments: 6-27 branch on nt 4.0. printed a mail mesgwith attachments (cnn.com and a jpeg) and it crashed.after i clicked ok in the print window (7789680) Comments: Printer error-not available (7789019) Comments: printing (7788957) Comments: printing msg with attachments crashed
Keywords: crash
Keywords: nsbeta1+
Whiteboard: [ADT1]
Old description was "Crash printing on branch build M1BR [@ nsPrintingPromptService::OnStateChange]" Not that there couldn't be a couple of null checks in that method, but the real problem is as follows: When printing a mail msg the MsgPrintEngine asks the msg to be loaded, when it is loaded the Engine gets notified with the flags set to: nsIWebProgressListener::STATE_IS_DOCUMENT & nsIWebProgressListener::STATE_STOP At that point print is called. The problem with printing mail that has an attachment is that a second notification comes thru when the attachment has finished loading and the Engine thinks it needs to call print a second time. At this point error dialogs start popping etc. and all bets are off. I will add a simple patch with the null checks for the method where it is crashing, but the problem described above is much more serious. This is a trunk and BRANCH issue. NOTE: It is not enough for the Engine to check to see if it is already printing, because you really don't want to print before the attachment is loaded. This was probably not a problem before because DocumentViewer's print method did a lot less error checking.
Assignee: rods → mscott
Summary: Crash printing on branch build M1BR [@ nsPrintingPromptService::OnStateChange] → Cannot print mail with attachments (all hell breaks loose)
Attached patch partial patchSplinter Review
This patch is extra protection for crashing but the main problem remains.
reassigning to cavin.
Assignee: mscott → cavin
Whiteboard: [ADT1] → [ADT1 rtm]
Attached patch temporary patch (obsolete) — Splinter Review
This patch stops it from crashing but the attachment doesn't print correctly because it isn't completely loaded. I would say we should use this patch ONLY if a complete solution would take too long to figure out or would be too risky at this point. NOTE: That patch 89795 would be needed if this patch goes in, but it is still worth it.
Bug 154745 was logged on it. I also narrowed down the problem that it's caused by specific URLs attachments. Mail attached with .html, .doc, .gif, .jpg, .xls, .ldif to print doesn't crash. Reproduced the problem on Gary and Stephen's machines that URLs attachment caused mail printing failure.
*** Bug 154745 has been marked as a duplicate of this bug. ***
Rod, I'm replacing the signature in the summary because that is the signature that Talkback is reporting. Having the signature is helpful in verifying your patch. Also, yulian listed the steps to repro this topcrash in duped bug 154745 -> topcrash+.
Keywords: topcrash+
Summary: Cannot print mail with attachments (all hell breaks loose) → Cannot print mail with attachments (all hell breaks loose) [@ nsPrintingPromptService::OnStateChange]
Cavin, Tried both commercial 2002-07-01-08-trunk 2002-07-01-08-1.0 On nt 4.0 I couldn't reproduce on trunk. I could on branch. At first I thought I could only crash on the very first time you view/print the mesg. But I could reproduce it on a consistent basis by setting my print options to print 'from page 1 to 1'. My test mesg, with html compose on, is mesg that I attached a jpeg (92kb) and then I used attach web page to attach cnn.com. Tried both a new and migrarated profiles and could crash. stack signiture is same. TB7898653W,TB789564Q,TB789215M.
Print a msg with CNN doesn't crash on the trunk, but I do get several error pop up dialogs from Printing (which is this problem)
using 2002-07-01-08-1.0 on NT 4.0, tried copying the mail mesg to a folder under Local Folders and then tried printing the mesg (using print from page 1 to 1). got the 2 error mesgs, then I crashed. The stack trace is the same. TB7901465E
My "partial patch" would stop the crash, but not the error dialogs. The real problem is stated above where we are printing when the wrong document is finished. We need to cal print when the attachment is done loading. Not sure how we would know that.
adding adt1.0.1+. Please get drivers approval before checking in.
taking bug
Assignee: cavin → rods
Rod, are you saying that we are calling Print to early in the document load process? i.e we are calling it after we get a notification that we've finished loading *something* even though that may not be the last pending request for the document? We may still have parts like the attachment which we are in the process of fetching?
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1
Needs reviews before this can be +'d. However, http://bugzilla.mozilla.org/show_bug.cgi?id=155430 looks like it solves this bug as well.
Keywords: adt1.0.1+adt1.0.1
mscott, yes, we can't start printing until after the main document finishes loading, the main doc being the mail msg. See patch in Bug 155430
07/02/02 branch build, Win2K. I tried to print the message with attached web page: cnn.com and got a few 'Not available' message from "Printer Error". My printer Properties shows 'Spooling' - it is already takes more than 10 min - no crashes so far. When I repeat the same steps I get printouts of messages with attached Time.com, www.aol.com. But first 3 printing jobs still show 'Spooling' and never got printed. No crashes. When my message has some text in addition to attached web page, this text gets printed following with the title of the page. The content of the page never gets printed - spooling.
I repeated tests on today's 07/03/02 branch build, Win2K - no crashes.
fixed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Adding DocumentViewerImpl::DonePrintingPages to summary since I think this same crash *was* being reported under that stack signature as well.
Summary: Cannot print mail with attachments (all hell breaks loose) [@ nsPrintingPromptService::OnStateChange] → Cannot print mail with attachments (all hell breaks loose) [@ nsPrintingPromptService::OnStateChange | DocumentViewerImpl::DonePrintingPages]
I could not reproduce this crashes on branch build last week. On today's trunk build, Win2K I don't see the crash when attach cnn.com and aol.com to the message. Printout came fine after that warning: 'Printer not available'. I repeated tests by printing messages with multiple attachments (cnn, aol) - no more error, no crashes, nice printouts. I change status to Verified.
Status: RESOLVED → VERIFIED
lowering impact and adding dependency to 155430 which will also fix this.
Depends on: 155430
Whiteboard: [ADT1 rtm] → [ADT2 rtm]
Attachment #89798 - Attachment is obsolete: true
adding adt1.0.1+ for the null check patch. Please get drivers approval before checking in.
Keywords: adt1.0.1adt1.0.1+
Comment on attachment 89795 [details] [diff] [review] partial patch a=chofmann for 1.0.1 add the fixed1.0.1 keyword after checking in.
Attachment #89795 - Flags: approval+
adding mozilla1.0.1+ based on chofmann's comments. Please check this into the branch and change the mozilla1.0.1+ to fixed1.0.1
applied first patch with extra null pointer check on branch
Verified on branch build 07/23/02, Win2K - no crashes when print cnn.com, aol.com or others.
Crash Signature: [@ nsPrintingPromptService::OnStateChange | DocumentViewerImpl::DonePrintingPages]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: