GeckoView Window.Print Needs to Block Multiple Calls
Categories
(GeckoView :: General, defect, P1)
Tracking
(firefox112 unaffected, firefox113+ disabled, firefox114+ fixed, firefox115+ fixed)
People
(Reporter: olivia, Assigned: olivia)
References
Details
(Keywords: sec-low)
Attachments
(3 files, 2 obsolete files)
Window.Print() on Android calls the Android Print Spooler to print.
This bug creates a trap where users cannot easily navigate away and can even lead to OOM.
To replicate, attach to a debugger on Android and call window.print()
many times from the about:debugging
content console or use the sample file.
The sample file calls window.print()
ten times. Calling it 1000+ times by making the loop larger can lead to an out of memory condition in the print spooler and crash. (Tested using mozemulator and GeckoView Example.)
--------- beginning of crash
2101 2101 E AndroidRuntime: FATAL EXCEPTION: main
2101 2101 E AndroidRuntime: Process: com.android.printspooler, PID: 2101
2101 2101 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 2134020 byte allocation with 1888304 free bytes and 1844KB until OOM
2101 2101 E AndroidRuntime: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
2101 2101 E AndroidRuntime: at android.graphics.Bitmap.nativeCreate(Native Method)
...
A similar bug is this one. A condition to prevent continually adding static clones was added to prevent using the beforeprint
to call for another print. However, this bug is occurring after window.print() releases the static clone, but while the dialog is still open and another window.print() call is made. A possible solution is to not release the static clone until the Android PrintJob resolves as completed by the PrintManager.
Users may also be trapped on Desktop (can't navigate back and previews appear until finished), but do not experience OOM as on Android.
Comment 1•2 years ago
|
||
This being an S1 severity issue suggests that it should be a release blocker for 113 and an RC respin driver. Is that accurate, Olivia? If so, I need a patch ASAP to either address this or disable the feature to avoid putting Tuesday's launch at risk.
Assignee | ||
Comment 2•2 years ago
|
||
Added an additional print option to PrintDelegate to have more
infromation on print status.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Added an additional print option to PrintDelegate to have more
infromation on print status.
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Per Slack discussion with the various stakeholders, we decided to slip the feature to 114 in order to allow for more bake time. The disabling has been landed for 113.0 RC2.
https://hg.mozilla.org/releases/mozilla-release/rev/484eaf4a9552
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Comment on attachment 9331650 [details]
Bug 1831223 - Added GeckoView Print Status
Beta/Release Uplift Approval Request
- User impact if declined: The print status information should ride the trains with the feature for window.print on Android.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce: This feature can be tested via visiting a website that includes a print button. For example, many recipe websites include a print button.
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This adds print status information for GeckoView window.print.
- String changes made/needed: None
- Is Android affected?: Yes
Assignee | ||
Comment 7•2 years ago
|
||
Added an additional print option to the PrintDelegate to have more
information on print status.
Original Revision: https://phabricator.services.mozilla.com/D177189
Assignee | ||
Comment 8•2 years ago
|
||
Added an additional print option to the PrintDelegate to have more
information on print status.
![]() |
||
Comment 9•2 years ago
|
||
Landed: https://hg.mozilla.org/integration/autoland/rev/06b409d9ea9549f2b9cdb4da4d4c96aaef295507
Backed out for causing linting failures for GeckoSession.java:
https://hg.mozilla.org/integration/autoland/rev/8e4e2a61e41e044d6ab484b435c8a01b3c604596
Assignee | ||
Comment 10•2 years ago
|
||
(In reply to Sebastian Hengst [:aryx] (needinfo me if it's about an intermittent or backout) from comment #9)
Landed: https://hg.mozilla.org/integration/autoland/rev/06b409d9ea9549f2b9cdb4da4d4c96aaef295507
Backed out for causing linting failures for GeckoSession.java:
https://hg.mozilla.org/integration/autoland/rev/8e4e2a61e41e044d6ab484b435c8a01b3c604596
Apologies, I ran the wrong linter locally. Updated and resubmitted. I'll fix the lints for beta uplift here shortly too.
Updated•2 years ago
|
Updated•2 years ago
|
![]() |
||
Comment 11•2 years ago
|
||
Added GeckoView Print Status r=geckoview-reviewers,jonalmeida
https://hg.mozilla.org/integration/autoland/rev/6752303f266a1222f277dd00c46c3486b5d9c26e
https://hg.mozilla.org/mozilla-central/rev/6752303f266a
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment on attachment 9332909 [details]
Bug 1831223 - Added GeckoView Print Status
Approved for Desktop 114.0b6 and Fenix/Focus 114.0b6.
Comment 13•2 years ago
|
||
uplift |
Comment 14•2 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/1b331dc943a65f3689a163cfce0605cc3a425b13
Backed out on beta due to a CI failure
https://treeherder.mozilla.org/logviewer?job_id=416250234&repo=mozilla-beta
Will follow-up in a later push to beta
Comment 15•2 years ago
|
||
uplift |
Updated•2 years ago
|
Updated•1 year ago
|
Description
•