Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle errors gracefully, in PartialEvaluator.buildFontPaths, when glyph path building fails #13381

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

The building of glyph paths, in the FontRendererFactory, can fail in various ways for corrupt font data. However, we're currently not attempting to handle any such errors in the evaluator, which means that a single broken glyph can prevent an entire page from rendering.

To address this we simply have to pass along, and check, the existing ignoreErrors option in PartialEvaluator.buildFontPaths similar to the rest of the PartialEvaluator code.

@Snuffleupagus
Copy link
Collaborator Author

Note that I stumbled upon this missing error handling when testing PR #13376 locally, using the PDF document from issue #7625.

@Snuffleupagus Snuffleupagus force-pushed the buildFontPaths-ignoreErrors branch 6 times, most recently from f26f65e to f014697 Compare May 21, 2021 20:57
@Snuffleupagus Snuffleupagus marked this pull request as ready for review May 21, 2021 21:04
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/574a6f7f58c78e0/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/6e1d6870f7b8a49/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/574a6f7f58c78e0/output.txt

Total script time: 26.48 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/574a6f7f58c78e0/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/6e1d6870f7b8a49/output.txt

Total script time: 30.04 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/6e1d6870f7b8a49/reftest-analyzer.html#web=eq.log

…glyph path building fails

The building of glyph paths, in the `FontRendererFactory`, can fail in various ways for corrupt font data. However, we're currently not attempting to handle any such errors in the evaluator, which means that a single broken glyph *can* prevent an entire page from rendering.

To address this we simply have to pass along, and check, the existing `ignoreErrors` option in `PartialEvaluator.buildFontPaths` similar to the rest of the `PartialEvaluator` code.
…ialEvaluator.translateFont`

*This is a small piece of clean-up that I happened to notice while browsing the code.*
@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/34dbd548495b056/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/3d0b1b9df39b56c/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/3d0b1b9df39b56c/output.txt

Total script time: 26.33 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/3d0b1b9df39b56c/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/34dbd548495b056/output.txt

Total script time: 29.40 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/34dbd548495b056/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit de680d7 into mozilla:master May 22, 2021
@timvandermeij
Copy link
Contributor

Thanks!

@Snuffleupagus Snuffleupagus deleted the buildFontPaths-ignoreErrors branch May 22, 2021 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants