Closed Bug 1661984 Opened 4 years ago Closed 4 years ago

Add a browser mochitest for the crash on printing when using container tab

Categories

(Core :: Printing: Output, defect, P2)

Firefox 82
defect

Tracking

()

VERIFIED FIXED
83 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox79 --- unaffected
firefox80 --- unaffected
firefox81 --- unaffected
firefox82 --- wontfix
firefox83 --- verified
firefox84 --- verified

People

(Reporter: tcampbell, Assigned: hiro)

References

(Regression)

Details

(Keywords: crash, regression, reproducible, Whiteboard: [print2020_v83][old-ui+])

Crash Data

Attachments

(2 files)

STR:

Expected:

  • Printed document

Actual:

  • Content tab crash nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy*, nsTSubstring<char> const&, nsTSubstring<char> const&, nsTSubstring<char> const&, bool, bool, bool, nsIArray*, bool, bool, bool, nsPIWindowWatcher::PrintKind, nsDocShellLoadState*, mozilla::dom::BrowsingContext**)

Windows 10 (2020.04), Firefox Nightly 82.

Crash Signature: [@ nsWindowWatcher::OpenWindowInternal ]
Type: task → defect

Looks like crashes on any pages.

Severity: -- → S1
Priority: -- → P1
Whiteboard: [print2020_v81][old-ui+]

mUserContextIds don't match in this DIAGNOSTIC_ASSERTION.

And when a document having iframes (e.g. https://www.w3schools.com/html/html_iframe.asp) is print-previewed in a container tab, I get Assertion failure: attrs.EqualsIgnoringFPD(docAttrs) on debug builds. I tried mozregression, but I can't go back to the original source, probably there are no longer debug builds, anyways, it's been since 72 at least.

I think the debug assertion is caused by the same root cause that is that we don't copy over the mUserContextIds from the original BrowsingContext.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)

I tried mozregression, but I can't go back to the original source, probably there are no longer debug builds, anyways, it's been since 72 at least.

Just confirming that you are saying bug 1636728 is not the regressor? (I'd try the old print preview but I'm on macOS.)

This crash is actually caused by bug 1636728, as in bug bug 1636728 is the regressor. That said, we haven't properly set mUserContextIds for printing documents, bug 1636728 just unwallpapered the long standing issue.

(Note that the crash happens on the old UI, but it's since bug 1636728)

Assignee: nobody → emilio
Flags: needinfo?(emilio)
See Also: → 1661867

Here is a browser mochitest to replicate the crash. Hopefully this should work as expected with a proper fix. :)

Bug 1661867 fixes this and includes a test, though probably the test should be landed anyhow.

Assignee: emilio → nobody
Depends on: 1661867
Flags: needinfo?(emilio)

Thank you, Emilio! I am going to land the test once after I confirmed it works fine with bug 1661867 .

Flags: needinfo?(hikezoe.birchill)

I am going to reuse this bug for adding the test.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Flags: needinfo?(hikezoe.birchill)
Summary: Printing crashes tab when using container tab → Add a browser mochitest for the crash on printing when using container tab
Depends on: 1662325
Attachment #9173252 - Attachment description: Bug 1661984 - Add a browser mochitest to make sure printing in a container tab doesn't crash. r?emilio → Bug 1661984 - Add a browser mochitest to make sure printing in a container tab doesn't crash. r?emilio,r?mstriemer!

This is just a test, downgrading the priority.

Priority: P1 → P2
Whiteboard: [print2020_v81][old-ui+] → [print2020_v82][old-ui+]
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0fc0697f44e7 Add a browser mochitest to make sure printing in a container tab doesn't crash. r=emilio,hiro

Can we back this out as the test it adds seems to fail?

Backed out changeset 0fc0697f44e7 (bug 1661984) for browser_print_in_container.js failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&searchStr=mochitest-browser-chrome&fromchange=2619cea16ed1f48b4b1bdf3d21aa9a4c81546285&tochange=f2d48bcf174d630f6d9922f302fa0ee1edff6ace&selectedTaskRun=C9vChTGkT5el3Ru3l_L94w.0

Backout link: https://hg.mozilla.org/integration/autoland/rev/f2d48bcf174d630f6d9922f302fa0ee1edff6ace

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315972868&repo=autoland&lineNumber=20421

[task 2020-09-17T16:50:19.715Z] 16:50:19     INFO - TEST-START | toolkit/components/printing/tests/browser_print_in_container.js
[task 2020-09-17T16:50:19.715Z] 16:50:19     INFO - GECKO(5959) | [Child 6197: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 0x7f1ff9997400 == 2 [pid = 6197] [id = {23e93d3e-3a35-4409-b087-4ad93b065322}]
[task 2020-09-17T16:50:19.716Z] 16:50:19     INFO - GECKO(5959) | [Child 6197: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 7 (0x7f1ffb7dc260) [pid = 6197] [serial = 48] [outer = (nil)]
[task 2020-09-17T16:50:19.716Z] 16:50:19     INFO - GECKO(5959) | [Child 6197: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 8 (0x7f1ff9999c00) [pid = 6197] [serial = 49] [outer = 0x7f1ffb7dc260]
[task 2020-09-17T16:50:19.716Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 6 (0x7f8cb4dae800) [pid = 6252] [serial = 6] [outer = (nil)] [url = about:printpreview]
[task 2020-09-17T16:50:19.723Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 5 (0x7f8cb4d54800) [pid = 6252] [serial = 2] [outer = (nil)] [url = about:blank]
[task 2020-09-17T16:50:19.723Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 4 (0x7f8cb4da8800) [pid = 6252] [serial = 5] [outer = (nil)] [url = about:blank]
[task 2020-09-17T16:50:19.723Z] 16:50:19     INFO - GECKO(5959) | [Parent 5959: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 0x7f64dba72400 == 24 [pid = 5959] [id = {fc5d5c92-3236-4dad-bede-4872edf06142}]
[task 2020-09-17T16:50:19.724Z] 16:50:19     INFO - GECKO(5959) | [Parent 5959: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 75 (0x7f64d93659a0) [pid = 5959] [serial = 81] [outer = (nil)]
[task 2020-09-17T16:50:19.724Z] 16:50:19     INFO - GECKO(5959) | [Parent 5959: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 0x7f64dc773000 == 25 [pid = 5959] [id = {f5e5f3b9-e840-47d0-a497-9b74e6ecee40}]
[task 2020-09-17T16:50:19.726Z] 16:50:19     INFO - GECKO(5959) | [Parent 5959: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 76 (0x7f64d9368a90) [pid = 5959] [serial = 82] [outer = (nil)]
[task 2020-09-17T16:50:19.728Z] 16:50:19     INFO - TEST-INFO | started process screentopng
[task 2020-09-17T16:50:19.990Z] 16:50:19     INFO - TEST-INFO | screentopng: exit 0
[task 2020-09-17T16:50:19.990Z] 16:50:19     INFO - Buffered messages logged at 16:50:19
[task 2020-09-17T16:50:19.990Z] 16:50:19     INFO - Entering test bound test
[task 2020-09-17T16:50:19.991Z] 16:50:19     INFO - Buffered messages finished
[task 2020-09-17T16:50:19.991Z] 16:50:19     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/printing/tests/browser_print_in_container.js | There is one print dialog - Got +0, expected 1
[task 2020-09-17T16:50:19.991Z] 16:50:19     INFO - Stack trace:
[task 2020-09-17T16:50:19.991Z] 16:50:19     INFO - chrome://mochikit/content/browser-test.js:test_is:1332
[task 2020-09-17T16:50:19.991Z] 16:50:19     INFO - chrome://mochitests/content/browser/toolkit/components/printing/tests/head.js:assertDialogHidden:75
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - chrome://mochitests/content/browser/toolkit/components/printing/tests/browser_print_in_container.js:test:26
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/printing/tests/browser_print_in_container.js | Uncaught exception - at chrome://mochitests/content/browser/toolkit/components/printing/tests/head.js:76 - TypeError: can't access property "_box", this.dialog is undefined
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - Stack trace:
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - assertDialogHidden@chrome://mochitests/content/browser/toolkit/components/printing/tests/head.js:76:5
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - test@chrome://mochitests/content/browser/toolkit/components/printing/tests/browser_print_in_container.js:26:10
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - Leaving test bound test
[task 2020-09-17T16:50:19.992Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 3 (0x7f8cd1493180) [pid = 6252] [serial = 4] [outer = (nil)] [url = https://example.com/browser/toolkit/components/printing/tests/file_coop_header.html]
[task 2020-09-17T16:50:19.993Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 2 (0x7f8cd1493520) [pid = 6252] [serial = 1] [outer = (nil)] [url = https://example.com/browser/toolkit/components/printing/tests/file_coop_header.html]
[task 2020-09-17T16:50:19.993Z] 16:50:19     INFO - GECKO(5959) | [Parent 5959, Main Thread] WARNING: NS_ENSURE_TRUE(presShell) failed: file /builds/worker/checkouts/gecko/dom/base/nsGlobalWindowOuter.cpp, line 4274
[task 2020-09-17T16:50:19.993Z] 16:50:19     INFO - GECKO(5959) | [Parent 5959, Main Thread] WARNING: NS_ENSURE_TRUE(presShell) failed: file /builds/worker/checkouts/gecko/dom/base/nsGlobalWindowOuter.cpp, line 4274
[task 2020-09-17T16:50:19.993Z] 16:50:19     INFO - GECKO(5959) | [Child 6197: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 9 (0x7f1ff99a0000) [pid = 6197] [serial = 50] [outer = 0x7f1ffb7dc260]
[task 2020-09-17T16:50:19.996Z] 16:50:19     INFO - GECKO(5959) | MEMORY STAT | vsize 3171MB | residentFast 428MB | heapAllocated 146MB
[task 2020-09-17T16:50:19.996Z] 16:50:19     INFO - TEST-OK | toolkit/components/printing/tests/browser_print_in_container.js | took 674ms
[task 2020-09-17T16:50:19.997Z] 16:50:19     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-09-17T16:50:19.997Z] 16:50:19     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/printing/tests/browser_print_in_container.js | Found an unexpected tab at the end of test run: https://example.com/browser/toolkit/components/printing/tests/simplifyArticleSample.html - 
[task 2020-09-17T16:50:19.998Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 0x7f8cb44af400 == 1 [pid = 6252] [id = {8475a24b-df6a-44a5-b4b5-cb692d0279b3}]
[task 2020-09-17T16:50:19.999Z] 16:50:19     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 3 (0x7f8cd1493180) [pid = 6252] [serial = 8] [outer = (nil)]
[task 2020-09-17T16:50:20.000Z] 16:50:20     INFO - GECKO(5959) | [Child 6252: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 4 (0x7f8cb44b0400) [pid = 6252] [serial = 9] [outer = 0x7f8cd1493180]
[task 2020-09-17T16:50:20.000Z] 16:50:20     INFO - checking window state
[task 2020-09-17T16:50:20.026Z] 16:50:20     INFO - GECKO(5959) | [Parent 5959, Main Thread] WARNING: 'aOwner->IsDiscarded()', file /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SyncedContextInlines.h, line 36
[task 2020-09-17T16:50:20.026Z] 16:50:20     INFO - GECKO(5959) | [Parent 5959, Main Thread] WARNING: 'aOwner->IsDiscarded()', file /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SyncedContextInlines.h, line 36
[task 2020-09-17T16:50:20.026Z] 16:50:20     INFO - GECKO(5959) | [Parent 5959, Main Thread] WARNING: 'aOwner->IsDiscarded()', file /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SyncedContextInlines.h, line 36
[task 2020-09-17T16:50:20.026Z] 16:50:20     INFO - GECKO(5959) | [Parent 5959, Main Thread] WARNING: 'aOwner->IsDiscarded()', file /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SyncedContextInlines.h, line 36
[task 2020-09-17T16:50:20.029Z] 16:50:20     INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "https://example.com/browser/toolkit/components/printing/tests/simplifyArticleSample.html" line: 0}]
Flags: needinfo?(hikezoe.birchill)
Flags: needinfo?(hikezoe.birchill) → needinfo?(mstriemer)
Flags: needinfo?(mstriemer)
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5d68f435c87f Add a browser mochitest to make sure printing in a container tab doesn't crash. r=emilio,hiro

Backed out for failing browser-chrome's browser_system_dialog_subdialog_hidden.js:

https://hg.mozilla.org/integration/autoland/rev/51e1fef0ad1933cc5e3df644f0ddd6816f5fae8e

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&resultStatus=retry%2Ctestfailed%2Cbusted%2Cexception%2Crunnable&revision=5d68f435c87f57ecae46e7feab64246a61d720ee

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=316101797&repo=autoland

[task 2020-09-18T18:07:59.170Z] 18:07:59 INFO - TEST-PASS | toolkit/components/printing/tests/browser_system_dialog_subdialog_hidden.js | The dialog is hidden -
[task 2020-09-18T18:07:59.171Z] 18:07:59 INFO - Buffered messages finished
[task 2020-09-18T18:07:59.171Z] 18:07:59 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/printing/tests/browser_system_dialog_subdialog_hidden.js | Uncaught exception - Wait for dialog to close - timed out after 50 tries.
[task 2020-09-18T18:07:59.172Z] 18:07:59 INFO - Leaving test bound testModalPrintDialog

Flags: needinfo?(hikezoe.birchill)
Severity: S1 → S3
Whiteboard: [print2020_v82][old-ui+] → [print2020_v83][old-ui+]
Attachment #9173252 - Attachment description: Bug 1661984 - Add a browser mochitest to make sure printing in a container tab doesn't crash. r?emilio,r?mstriemer! → Bug 1661984 - Add a browser mochitest to make sure printing in a container tab doesn't crash. r=emilio,hiro
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39187df1e83a Add a browser mochitest to make sure printing in a container tab doesn't crash. r=emilio,hiro
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

I'm able to reliably reproduce this crash in the latest Nightly 83.0.a1 (2020-10-12) on macOS:

STR with Fission enabled:

  1. Open a new non-Fission window.
  2. Go to https://developers.google.com/youtube/youtube_player_demo. Note this page has a cross-origin iframe.
  3. Once page loads hit Cmd+P

Example crash report: https://crash-stats.mozilla.org/report/index/c59ee04a-cf41-4d0d-8def-4d7e20201012

I cannot reproduce this in a Fission window. Seems like the same crash but different STR (not a container this time).

Hiro: Shall we reopen or file a new bug?

Actually, printing anything from a non-Fission window with Fission enabled crashes.

(In reply to Sean Voisen (:svoisen) from comment #21)

Actually, printing anything from a non-Fission window with Fission enabled crashes.

This was filed as bug 1670821.

Flags: qe-verify+

This issue is verified fixed using Firefox 84.0a1 (BuildId:20201026092834) and Firefox 83.0b4 (BuildId:20201025174155 - By manually enabling the container tabs feature) on Windows 10 64bit, macOS 10.15 & Ubuntu 20.04

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Flags: needinfo?(hikezoe.birchill)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: