Closed Bug 1662090 Opened 4 years ago Closed 4 years ago

Crash in [@ mozilla::dom::Document::CloneDocHelper]

Categories

(Core :: DOM: Core & HTML, defect)

Unspecified
All
defect

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
thunderbird_esr78 --- unaffected
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- wontfix
firefox82 --- fixed

People

(Reporter: wsmwk, Assigned: emilio)

References

Details

(4 keywords, Whiteboard: [tbird topcrash])

Crash Data

Attachments

(2 files, 1 obsolete file)

Most crashes are version 81

Crash report: https://crash-stats.mozilla.org/report/index/e258189d-fa1b-482d-9214-3c1330200831

Top 10 frames of crashing thread:

0 xul.dll mozilla::dom::Document::CloneDocHelper const dom/base/Document.cpp:11191
1 xul.dll nsHTMLDocument::Clone const dom/html/nsHTMLDocument.cpp:673
2 xul.dll static nsINode::CloneAndAdopt dom/base/nsINode.cpp:3103
3 xul.dll nsINode::CloneNode dom/base/nsINode.cpp:2981
4 xul.dll mozilla::dom::Document::CreateStaticClone dom/base/Document.cpp:12280
5 xul.dll nsPrintObject::InitAsRootObject layout/printing/nsPrintObject.cpp:111
6 xul.dll nsPrintJob::DoCommonPrint layout/printing/nsPrintJob.cpp:667
7 xul.dll nsPrintJob::CommonPrint layout/printing/nsPrintJob.cpp:587
8 xul.dll nsPrintJob::Print layout/printing/nsPrintJob.cpp:919
9 xul.dll nsDocumentViewer::Print layout/base/nsDocumentViewer.cpp:3168
Flags: needinfo?(mkmelin+mozilla)

81 crashes started with 20200828195907 build

Print related?

Yes seems to be from printing.

Looks like it's crashing due to null mTiming. Maybe the MOZ_ASSERT should be MOZ_CRASH instead? https://searchfox.org/mozilla-central/source/dom/base/Document.cpp#11192 but of course that wouldn't fix the problem...

Or add an MaybeInitTiming() call to https://searchfox.org/mozilla-central/rev/969fc7fa6c3c7fc489f53b7b7f8c902028b5169f/dom/html/nsHTMLDocument.cpp#672 ?

Component: General → DOM: Core & HTML
Flags: needinfo?(mkmelin+mozilla)
Product: Thunderbird → Core
Version: Thunderbird 81 → unspecified
Flags: needinfo?(emilio)
Flags: needinfo?(jwatt)

This is my fault, kinda. Thunderbird is using nsIWebBrowserPrint.print() directly and that no longer works unless you do it on a pre-cloned document.

This line should instead go through nsGlobalWindowOuter::Print.

Magnus, can you fix? Or should I try to do it? I can probably take a bit of time later this week, just ni? me back.

Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(jwatt)
Flags: needinfo?(emilio)
Blocks: 1661626
QA Whiteboard: [qa-regression-triage]
Attached patch bug1662090_print_outer.patch (obsolete) — Splinter Review

Not sure if this was what you had in mind. But it doesn't really work. It doesn't pop up the print window. The "printing" dialog is shown but I don't see where that print would have gone either.

Thanks for any pointers.

Flags: needinfo?(mkmelin+mozilla)

Yeah I'd have expected something like that to work. I have a bit of time today so I can look into it.

Flags: needinfo?(emilio)

Something like this works, though it needs a patch to printUtils.js because this throws.

The printing setup in nsMsgPrintEngine is kinda gross. We open a new window with msgPrintEngine.xhtml which actually does the printing... I have no idea why it has to be so complicated.

Assignee: nobody → emilio
Flags: needinfo?(emilio)

This is all we really need and allows Thunderbird to use this rather
than rolling their own thing.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd85b98c3c80
Don't rely on gBrowser in PrintUtils.startPrintWindow. r=jwatt

Magnus, ni? so that the patch above in comment 6 doesn't get lost, I don't know what the procedure to get stuff landed in comm-central is.

Flags: needinfo?(mkmelin+mozilla)
Keywords: leave-open

Thanks! Will get it landed once the mozilla-central part is merged from autoland.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/e443bcd3256b
Fix nsMsgPrintEngine. r=mkmelin
Attachment #9173851 - Attachment is obsolete: true
Flags: needinfo?(mkmelin+mozilla)
Comment on attachment 9174009 [details] [diff] [review]
fix-print-engine.patch

Review of attachment 9174009 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/imap/src/nsImapProtocol.cpp
@@ +9614,5 @@
>    return NS_OK;
>  }
>  
>  NS_IMETHODIMP nsImapMockChannel::Suspend() {
> +  // MOZ_ASSERT_UNREACHABLE("nsImapMockChannel::Suspend");

Removed these, that it triggers is another bug that turned up on trunk.
Attachment #9174009 - Flags: review+
Status: NEW → RESOLVED
Closed: 4 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Would be wonderful to have this uplifted to 81 beta to fix #1 crash https://crash-stats.mozilla.org/topcrashers/?product=Thunderbird&version=81.0&_facets_size=50

OS: Windows 10 → All
Whiteboard: [tbird topcrash]

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Do you need this uplifted Magnus?

Flags: needinfo?(emilio) → needinfo?(mkmelin+mozilla)

With merge date so close, I think it's not necessary to uplift.

Flags: needinfo?(mkmelin+mozilla)

print crash is fixed for me on 82.0b1, i'm able to print again

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/8ba0e81e1821
followup - clang-format. rs=clang-format

My selected events in my calendar are still not printing.

82.0B1 still not printing, the print preview just hangs up and the print does nothing

beta 82 users - if you still have a problem it may be better to post in your original bug report please

Blocks: 1667902
See Also: → 1677819

No crashes reported for thunderbird beta 83 in last 6 months

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: