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

[JS] Use heap allocation when initializing quickjs sandbox #13286

Merged
merged 1 commit into from Apr 23, 2021

Conversation

calixteman
Copy link
Contributor

  • In case of large string the sandbox initialization failed because of an OOM
    • so allocate a new string in the heap
    • and free it after use.
  • it requires a quickjs update since we need to export some symbols (stringToNewUTF8 and free).

  - In case of large string the sandbox initialization failed because of an OOM
    * so allocate a new string in the heap
    * and free it after use.
  - it requires a quickjs update since we need to export some symbols (stringToNewUTF8 and free).
@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/49d598c4b0f1cae/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/5a2f5fdc3fb866d/output.txt

@Snuffleupagus
Copy link
Collaborator

Do you have an example of a PDF document, that you can share, which triggers this behaviour?

@calixteman
Copy link
Contributor Author

calixteman commented Apr 23, 2021

Sure, the pdf attached to this issue:
#12593
contains a lot of JS and the final string (sent to the sandbox) has a length around 6Mb.

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/49d598c4b0f1cae/output.txt

Total script time: 25.93 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/5a2f5fdc3fb866d/output.txt

Total script time: 28.46 mins

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

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

@Snuffleupagus
Copy link
Collaborator

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/32b7b597b81d091/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/32b7b597b81d091/output.txt

Total script time: 4.54 mins

Published

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, since sandbox initialization now works in the GENERIC viewer.

@calixteman calixteman merged commit 762cfd2 into mozilla:master Apr 23, 2021
@calixteman calixteman deleted the heap branch April 23, 2021 10:04
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

4 participants