Closed Bug 2091596 Opened 5 days ago Closed 3 days ago

PDF renderer showing blank or incomplete pages

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 160
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox160 + fixed
firefox161 + fixed
firefox162 + fixed

People

(Reporter: carmudgeon, Assigned: jnicol)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files, 3 external files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:160.0) Gecko/20100101 Firefox/160.0

Steps to reproduce

Open a link to display a PDF document from any website.

Actual results

PDF renderer displays blank, or incomplete pages. Saving, or downloading the document to disk shows they are intact and displayed properly by other readers. Regression first appeared in Firefox 160.

Examples:
https://images.thdstatic.com/catalog/pdfImages/2d/2d051972-59f4-4ddd-b1c3-d8b8099d6571.pdf
https://pdf.lowes.com/productdocuments/10384c8d-5d85-4ffd-be04-a60c17eab42d/09207003.pdf

Expected results

Renderer properly displays PDF document in Firefox window.

The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → PDF Viewer

:carmudgeon, is it better if you set pdfjs.enableHWA to false in about:config ?

Flags: needinfo?(carmudgeon)

I have the same issue. All PDFs are blank when opened in Firefox. The same PDFs work on the previous release without display problems.

The release notes mentioned something about WebGL switching to Apple's Metal graphics API. I therefore tried disabling WebGL using the webgl.disabled = true switch in about:config and surprisingly my PDF display issues disappeared. The obvious downside is that sites using WebGL don't work anymore.

My setup: Firefox 160.0 on Intel Mac 10.15 (latest Apple upgrades applied).

I don't think it's a pdf.js bug but more likely a gfx one.
:jnicol, wdyt ? Could it be a regression from bug 2079810 ?

Flags: needinfo?(jnicol)

Hmm, the Metal change shouldn't affect macOS 10.15

Could you both please attach your about:support information?

If you're able to run mozregression that would really help us track down the cause

Flags: needinfo?(jnicol) → needinfo?(siedlungshaus)
Attached file about:support β€”

(In reply to Calixte Denizet (:calixte) from comment #2)

:carmudgeon, is it better if you set pdfjs.enableHWA to false in about:config ?

Yes, flipping the setting restores proper display.

Like siedlunghaus, I'm also running 15.8.3 on an Intel Mac. This is actually the first time I've encountered any issue with PDF display.

Flags: needinfo?(carmudgeon)

Given the AMD GPU, I suspect this is another instance of bug 2074540, and the workaround needs to be applied to all AMD GPUs rather than just the GFX10

Does setting webgl.disable-angle=true fix it? (After re-enabling pdfjs.enableHWA)

See Also: → 2074540

(In reply to Jamie Nicol [:jnicol] from comment #8)

Given the AMD GPU, I suspect this is another instance of bug 2074540, and the workaround needs to be applied to all AMD GPUs rather than just the GFX10

Does setting webgl.disable-angle=true fix it? (After re-enabling pdfjs.enableHWA)

No, it does not.

(pdfjs.enableHWA = true) seems to be the key to making the pages blank, or only partially render.

As long is it is enabled, the webgl setting has no effect.

Thanks for testing. Just to confirm, did you restart firefox after setting webgl.disable-angle? It needs to be restarted to take affect, sorry I should have said that originally.

Edit: actually I don't think that's true. So you can disregard this message. sorry for the noise

(In reply to Jamie Nicol [:jnicol] from comment #10)

Thanks for testing. Just to confirm, did you restart firefox after setting webgl.disable-angle? It needs to be restarted to take affect, sorry I should have said that originally.

Edit: actually I don't think that's true. So you can disregard this message. sorry for the noise

No problem.

I did not restart the browser, but did clear the cache.

However, I just tested again, by setting the webgl entry to true, leaving the pdfjs entry as true, quit and restarted, and found that it does render properly.

(In reply to Jamie Nicol [:jnicol] from comment #10)

Thanks for testing. Just to confirm, did you restart firefox after setting webgl.disable-angle? It needs to be restarted to take affect, sorry I should have said that originally.

Edit: actually I don't think that's true. So you can disregard this message. sorry for the noise

I can also confirm, that setting webgl.disable-angle to true mostly fixes the issue with the blank pages after a restart. Some minor glitches with font rendering still remain. These glitches were present in earlier versions before FF 160 though, and started appearing a few releases back. Some PDFs with more elaborate layouts have clipped single characters, meaning that only half of the character is visible, sprinkled all over the page. I have to find a PDF I'm comfortable sharing here. Once I find one I can upload it or make a screenshot, if that's helpful.

My Intel Mac indeed has an AMD GPU too. I believe the model to be AMD Radeon RX 470.

Flags: needinfo?(siedlungshaus)

Okay I think it's almost certainly the AMD issue then. Thanks for testing, both!

Assignee: nobody → jnicol
Component: PDF Viewer → Graphics: Canvas2D
Keywords: regression
Product: Firefox → Core
Regressed by: 2079810

Would you be able to test this build (from here if you want to see the code change) and see if it solves the issue? Thanks!

Flags: needinfo?(siedlungshaus)
Flags: needinfo?(carmudgeon)
Status: UNCONFIRMED → NEW
Ever confirmed: true

I'm willing to test, but don't know how this works.

Is it safe to run this program when existing Firefox installs and profiles are present?
Should I maybe run it with another user account on my Mac?

Flags: needinfo?(siedlungshaus)

Yes safe to run with existing Firefox installs. Just open it from the DMG instead of dragging to applications. I think it will use the default nightly profile so if you already have Firefox nightly installed it will use its profile, but won't touch regular firefox's or any custom profiles

In bug 2074540 we disabled the unsynchronized glMapBufferRange fast path
for DrawTargetWebgl buffer uploads on Radeon GFX10 GPUs when ANGLE is
enabled, falling back to glBufferSubData. We have now received reports
of a similar bug on additional AMD GPUs.

Avoid the bug by taking the glBufferSubData path on all AMD GPUs.

I tried the test built earlier today and could not reproduce the blank PDF page issue.

Thank you for taking care of this πŸ™. I don't know what I would do without the trusty Firefox app on my Intel iMac.

Great, thank you for testing!

Pushed by jnicol@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c43cc54089f8 https://hg.mozilla.org/integration/autoland/rev/64b1eac6cb5d Expand ANGLE Radeon GFX10 buffer upload workaround to all AMD GPUs. r=gfx-reviewers,bradwerth

:jnicol, we could include this in the planned Fx160 dot release if you add a release-uplift request in time.
Assuming it's low risk? Could you add a beta and release uplift request

Flags: needinfo?(jnicol)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Broken pdfjs, canvas, and webgl content for users on Mac with AMD GPUs
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Falls back to known working slow path on affected GPUs.
  • String changes made/needed?: N/A
  • Is Android affected?: no
Attachment #9682170 - Flags: approval-mozilla-beta?

In bug 2074540 we disabled the unsynchronized glMapBufferRange fast path
for DrawTargetWebgl buffer uploads on Radeon GFX10 GPUs when ANGLE is
enabled, falling back to glBufferSubData. We have now received reports
of a similar bug on additional AMD GPUs.

Avoid the bug by taking the glBufferSubData path on all AMD GPUs.

Original Revision: https://phabricator.services.mozilla.com/D342064

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: Broken pdfjs, canvas, and webgl content for users on Mac with AMD GPUs
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Falls back to known working slow path on affected GPUs.
  • String changes made/needed?: N/A
  • Is Android affected?: no
Attachment #9682171 - Flags: approval-mozilla-release?

In bug 2074540 we disabled the unsynchronized glMapBufferRange fast path
for DrawTargetWebgl buffer uploads on Radeon GFX10 GPUs when ANGLE is
enabled, falling back to glBufferSubData. We have now received reports
of a similar bug on additional AMD GPUs.

Avoid the bug by taking the glBufferSubData path on all AMD GPUs.

Original Revision: https://phabricator.services.mozilla.com/D342064

Yes it's low risk. Definitely would be good to uplift

Flags: needinfo?(jnicol)

Just tried the nightly build, and it functions properly with my existing profile.

Thank you all for the prompt response and effort in resolving the glitch!

Flags: needinfo?(carmudgeon)
Status: NEW → RESOLVED
Closed: 3 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
Attachment #9682170 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
See Also: → 2091902
Attachment #9682171 - Flags: approval-mozilla-release? → approval-mozilla-release+
Blocks: 2091902
See Also: 2091902 →
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: