Closed Bug 1588435 Opened 5 years ago Closed 3 years ago

huge pdf cause system freeze

Categories

(Firefox :: PDF Viewer, defect, P3)

60 Branch
defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: nickkuz, Unassigned)

References

()

Details

(Keywords: hang, parity-chrome)

Attachments

(5 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

open a link:
https://docs.microsoft.com/en-us/sql/opbuildpdf/ab252483/toc.pdf?branch=live&view=sql-server-ver15
Is is MS SQL Documentation having >24k pages (!). Unfortunately, save-link-as doesn't work for this link. You have to open this link and wait until pdf.js opens a document.

Actual results:

pdf.js starts to download and render the file, and quickly exhausts system memory, which is in turn leads to system freeze, including no response to mouse and keyboard events.
System details: Linux x64 (Debian 9), 16 Gb RAM, CPU intel i5, Firefox 60.9.0esr from official repo
PS: Google Chrome successfully loads and shows this PDF in several minutes. pdf size in 185 Mb

Expected results:

pdf.js should catch a situation, when resources are not sufficient, and stop the rendering, then offer user an option to download file instead of rendering

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
20191009172106

(In reply to Nick Y Kuzminyh from comment #0)

Unfortunately, save-link-as doesn't work for this link.

Works for me.

Has STR: --- → yes
Component: Untriaged → PDF Viewer
Keywords: hang

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
20191014095234

Loaded the link in Nightly. The first page shows up, but subsequent pages seem stuck blank with the loading throbber on top (I got tired of waiting after about 2 minutes). Neither OS or browser hanged.

Keywords: parity-chrome

(In reply to Gingerbread Man from comment #1)

Works for me.
Sorry for misleading, I confirm, that Save-link-as works.

(In reply to Gingerbread Man from comment #2)

Loaded the link in Nightly. The first page shows up, but subsequent pages seem stuck blank with the loading throbber on top (I got tired of waiting after about 2 minutes). Neither OS or browser hanged.

To reproduce the bug, wait several minutes until document is loaded more than 10-20%. Try to open pages 30-100.
At level 10%, memory consumption is ~8G, at level near 20% consumption reaches 16G and my system falls into critical swapping, that in turn causes system freeze as a described earlier. Even if you get luck to close pdf rendering tab before system freeze, memory is freed only in several minutes (exact time depends on system tuning).

I think, FF should detect critical lack of resources and show a Dialog to stop a tab that consumes more than 50% of available RAM.

ps. May be this is fixed in more recent version of FF than 60esr?)

Type: enhancement → defect
Priority: -- → P2

I am trying to see if a slow almost hung rendering issue with a PDF from a Japanese government site has something in common with this bugzilla.
I am not sure if it does, but here is what I found out about this bugzilla's link today.
I am using a Windows 10 Pro PC with 32GB of memory. (AMD Ryzen 7 1700 Eight-Core Processor 3.00 GHz).

The original link in the original post does not exist any more.
However, when I click on the original link, MS website cleverly suggested a possible hit that has moved. A few of them.
One of them, "SQL Server docs navigation tips - SQL Server" seems to contain the similar document (slightly updated. It now has 25k+ pages.)

https://docs.microsoft.com/en-us/sql/sql-server/sql-docs-navigation-guide?view=sql-server-ver15

I have accessed that link and hit Download PDF in the lower-left corner to obtain the PDF with 25+K pages.

More about what I have found out about rendering the PDF in modern FF 90.0.2 (64-bit)

When I click the Download PDF button, my FF 90.0.2 (64-bit) began downloading the page.
It took almost five minutes. (Chrome also needs similar time to load it. So it is server issue. 25+K page PDF must be large.)

Now, however, I note that even during this downloading I can switch tabs, etc. (This should be the case).
I notice however, that once the loading is finished (the blue bar goes to the rightmost edge), NOTHING HAPPENED.
Absolutely nothing. All white pages and circular cursor that indicates something is being done remains as such.

After a couple of no action, Just on a hunch, I let FF continue what it was doing, and I opened the same link and try to see if Google Chrome can render this page and began downloading the PDF in Google chrome.
Google chrome took almost five minutes (similar time) to download the page.
Still FF did not show anything white page at all. (And as far as I could tell, during that time, there was no memory usage bump when FF finished loading the page.)

Surprise. Google Chrome, once it downloaded the whole page, IMMEDIATELY showed / rendered the pages. All 25+K of them. I could move between the pages using the scroll button on the right edge.
FF is a total failure in comparison.

Many PDF.js slow/hung issues seem to be related to bloated memory usage.
Note however, when I used FF to render the PDF, it took 5 minutes to download it, but nothing happened for 10 minutes afterward. And for the first couple of minutes, there was no memory usage increase as seen by task manger at all. This is very puzzling.

OTOH, Google Chrome took similar amount of time to download this page and then IMMEDIATELY showed/render the first page and I could quickly scroll down many pages using scroll bar on the right edge. All 25+K pages. Amazing.

When terminated Google Chrome, the memory usage dropped by about 1GB as shown in the attached memory usage captured by Windows task manager's memory usage monitor. Not bad for such a big PDF.

Something is very wrong with FF PDF.js renderer.

However, even when FF did have an issue with the PDF, I could still switch between tabs, etc. That is FF UI was not blocked at all. This is different from a problem I have and been investigating with a PDF file from a Japanese government site. :-(

I have downloaded the PDF mentioned in comment 5.
It is about 196MB.
Is there any place I can upload this for permanent storage so that the test for this bugzilla can be reproducible easily by others?

TIA.

I can confirm this bug with the Nightly build on Win 10, I downloaded the file and opened it locally.

The bug seems to be related to the scaling. When changing the default "automatic" to a scale of 110% the PDF page renders in about 8 sec.

Severity: normal → --
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: P2 → P3
Commit merged into master by GitHub Authored by Tim van der Meij (timvandermeij)
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
QA Whiteboard: [qa-96b-p2]
Target Milestone: --- → 96 Branch

Verified on Windows 10X64 and Ubuntu 20.

QA Whiteboard: [qa-96b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: